mirror of
https://github.com/openai/CLIP.git
synced 2026-11-05 01:37:26 +00:00
[GH-ISSUE #92] Half precision error on forward pass of RN50 and RN101 models #84
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
openai/CLIP#84
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 @spetryk on GitHub (Apr 10, 2021).
Original GitHub issue: https://github.com/openai/CLIP/issues/92
Hi, thanks for putting together a great repo. It has worked smoothly, except for the following:
When running the line
logits_per_image, logits_per_text = model(image, text)with the RN50 or RN101 models, I run into the following error:And then there's a bunch of C-looking code from the error message that I can post if needed.
A sample of the code I ran, for reference (though it's pretty much straight from the example):
It seems sort of indeterministic - in a for loop, sometimes it runs for one pass and breaks on the second. Sometimes it breaks on the first.
I'm using one GPU. The
textis dtypetorch.int64, andimageis dtypetorch.float32.However, the forward pass works with the RN50x4 and ViT-B/32 models.
There are a couple other issues at the moment that address half-precision:
Yet, these don't mention problem I'm running into.
Any help would be really appreciated!
@jongwook commented on GitHub (Apr 11, 2021):
Can you try supplying
jit=Falsewhile loading the model? I'm thinking of making jit=False the default since it's less compatible across PyTorch versions. (cf. #79)@spetryk commented on GitHub (Apr 12, 2021):
Great, that seems to have been the problem! It's working now. Thanks! 🎉
@ooza commented on GitHub (May 17, 2021):
@spetryk
Hi, as a new in the domain of image captioning, I'm wondering if the text_list was prepared by yourself or it's a default setting?
What should I prepare if I want to test the available clip models on my own images ?
Thanks