[GH-ISSUE #106] is there any way to work with torchvision 0.9.0 instead of 0.8.2 ? #94

Closed
opened 2026-10-31 21:11:03 +00:00 by bsakaguchi · 3 comments
Owner

Originally created by @nickums on GitHub (May 16, 2021).
Original GitHub issue: https://github.com/openai/CLIP/issues/106

Is there any way I can install and run with torchvision 0.9.0?
I have this version and pip cannot find the 0.8.2 required by CLIP

Originally created by @nickums on GitHub (May 16, 2021). Original GitHub issue: https://github.com/openai/CLIP/issues/106 Is there any way I can install and run with torchvision 0.9.0? I have this version and pip cannot find the 0.8.2 required by CLIP
Author
Owner

@torridgristle commented on GitHub (May 21, 2021):

I can run CLIP without issue on PyTorch 1.8.1+cu101 and Torchvision 0.9.1+cu101 with a small change. I compared 1000 image encodes with and without this change, the difference seems small and the cosine similarity between the encodes with and without the change were all 1.0 or 0.999 aside from one outlier.

If you have everything you need to run CLIP, just not the old versions of things it asks for, install it with

pip install --no-deps git+https://github.com/openai/CLIP.git
pip install --no-deps ftfy regex tqdm

and load CLIP with clip.load("ViT-B/32", jit=False). It needed the jit=False for a reason unknown to me.

<!-- gh-comment-id:846085583 --> @torridgristle commented on GitHub (May 21, 2021): I can run CLIP without issue on PyTorch 1.8.1+cu101 and Torchvision 0.9.1+cu101 with a small change. I compared 1000 image encodes with and without this change, the difference seems small and the cosine similarity between the encodes with and without the change were all 1.0 or 0.999 aside from one outlier. If you have everything you need to run CLIP, just not the old versions of things it asks for, install it with ``` pip install --no-deps git+https://github.com/openai/CLIP.git pip install --no-deps ftfy regex tqdm ``` and load CLIP with `clip.load("ViT-B/32", jit=False)`. It needed the jit=False for a reason unknown to me.
Author
Owner

@nickums commented on GitHub (May 23, 2021):

many thanks for that extremely helpful info, --no-deps is a revelation.
I now have to wrestle with 'AttributeError: module 'clip' has no attribute 'load'

<!-- gh-comment-id:846527713 --> @nickums commented on GitHub (May 23, 2021): many thanks for that extremely helpful info, --no-deps is a revelation. I now have to wrestle with 'AttributeError: module 'clip' has no attribute 'load'
Author
Owner

@jongwook commented on GitHub (Jul 19, 2021):

A recent commit (db20393f4a) removed the specific torch and torchvision versions from requirements.txt to avoid the dependency hell and also the conda/pip UX fiasco to some degree. Now the code should work okay with reasonably recent torch/torchvision although future updates may break these anytime. I'd still recommend pinning their versions that works for your application!

<!-- gh-comment-id:882504598 --> @jongwook commented on GitHub (Jul 19, 2021): A recent commit (db20393f4affd4158528bd868478e516ebed0944) removed the specific torch and torchvision versions from `requirements.txt` to avoid the dependency hell and also the conda/pip UX fiasco to some degree. Now the code should work okay with reasonably recent torch/torchvision although future updates may break these anytime. I'd still recommend pinning their versions that works for your application!
Sign in to join this conversation.
No labels
pull-request
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
openai/CLIP#94
No description provided.