[GH-ISSUE #13] Problem with batch #10

Open
opened 2026-10-31 21:16:05 +00:00 by bsakaguchi · 3 comments
Owner

Originally created by @op0112358 on GitHub (Mar 1, 2023).
Original GitHub issue: https://github.com/pharmapsychotic/clip-interrogator-ext/issues/13

"The size of tensor a (4) must match the size of tensor b (3) at non-singleton dimension 0al progress: 0it [00:00, ?it/s]"

I get this error when I try to use batch. I have a 3060 for what its worth, and I'm able to interrogate without batch just fine.

Originally created by @op0112358 on GitHub (Mar 1, 2023). Original GitHub issue: https://github.com/pharmapsychotic/clip-interrogator-ext/issues/13 "The size of tensor a (4) must match the size of tensor b (3) at non-singleton dimension 0al progress: 0it [00:00, ?it/s]" I get this error when I try to use batch. I have a 3060 for what its worth, and I'm able to interrogate without batch just fine.
Author
Owner

@op0112358 commented on GitHub (Mar 5, 2023):

The fix is to write .convert('RGB') at the end of image = Image.open(os.path.join(folder, file))

example:
for file in files:
image = Image.open(os.path.join(folder, file)).convert('RGB')
prompt = interrogate(image, mode)
txt_file = os.path.splitext(file)[0] + ".txt"
with open(os.path.join(folder, txt_file), 'w', encoding='utf-8') as f:
f.write(prompt)

            shared.total_tqdm.update()
            if shared.state.interrupted:
<!-- gh-comment-id:1455214539 --> @op0112358 commented on GitHub (Mar 5, 2023): The fix is to write .convert('RGB') at the end of image = Image.open(os.path.join(folder, file)) example: for file in files: image = Image.open(os.path.join(folder, file)).convert('RGB') prompt = interrogate(image, mode) txt_file = os.path.splitext(file)[0] + ".txt" with open(os.path.join(folder, txt_file), 'w', encoding='utf-8') as f: f.write(prompt) shared.total_tqdm.update() if shared.state.interrupted:
Author
Owner

@Dragoy commented on GitHub (Mar 6, 2023):

I confirm that this method works!

<!-- gh-comment-id:1456730593 --> @Dragoy commented on GitHub (Mar 6, 2023): I confirm that this method works!
Author
Owner

@pharmapsychotic commented on GitHub (Mar 6, 2023):

Thanks @lync11 good catch! Latest version 0.0.9 now includes this fix

<!-- gh-comment-id:1456743767 --> @pharmapsychotic commented on GitHub (Mar 6, 2023): Thanks @lync11 good catch! Latest version 0.0.9 now includes this fix
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
pharmapsychotic/clip-interrogator-ext#10
No description provided.