mirror of
https://github.com/pharmapsychotic/clip-interrogator-ext.git
synced 2026-11-05 01:27:20 +00:00
[GH-ISSUE #13] Problem with batch #10
Labels
No labels
enhancement
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
pharmapsychotic/clip-interrogator-ext#10
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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.
@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)
@Dragoy commented on GitHub (Mar 6, 2023):
I confirm that this method works!
@pharmapsychotic commented on GitHub (Mar 6, 2023):
Thanks @lync11 good catch! Latest version 0.0.9 now includes this fix