mirror of
https://github.com/openai/CLIP.git
synced 2026-11-05 01:37:26 +00:00
[GH-ISSUE #180] AttributeError: module 'clip' has no attribute 'load' #156
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#156
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 @jennasawaf on GitHub (Nov 15, 2021).
Original GitHub issue: https://github.com/openai/CLIP/issues/180
I've been working with CLIP for a few weeks now, but for some reason my code stopped working.
This is the code:
import torch
import clip
device = "cuda" if torch.cuda.is_available() else "cpu"
og_model, preprocess = clip.load('ViT-B/32', device)
then the error I get is the following

:
I tried testing the same code in a sagemaker notebook on aws and it worked there so I'm starting to think it might be because I'm working on a Mac? please let me know if there's something I can do to get it to work.
@jongwook commented on GitHub (Nov 16, 2021):
do you have a local directory named
clipor a file namedclip.pyin the same directory?@thandal commented on GitHub (Dec 17, 2021):
I think you need to install 'clip-by-openai', not 'clip':
pip3 install clip-by-openai@jongwook commented on GitHub (Dec 17, 2021):
Please note that
clip-by-openaiis not managed/endorsed by OpenAI.I realize the OP might've installed
clipfrom PyPI, which they shouldn't -- if that's the case, uninstall it bypip uninstall clipand follow the instructions in README.md to install CLIP properly.@davitpapikyan commented on GitHub (Dec 3, 2022):
Use the latest stable version by installing openai-clip:
@hrx20000209 commented on GitHub (Dec 14, 2022):
wow! thanks!! you figure out what I am looking for!
@haodong2000 commented on GitHub (Sep 29, 2023):
@davitpapikyan thx!
@Bilal143260 commented on GitHub (Jan 15, 2024):
pip install git+https://github.com/openai/CLIP.git
@Riyue120 commented on GitHub (Jan 15, 2024):
I had some problems, but they worked out.
Firstly
then i upgrade the
pip,pip install --upgrade pipthen it works.pip3 install git+https://github.com/openai/CLIP.git --userSecondly
so, i tried the above method,
pip install openai-clip, but it does not work.then, i rename my python file name and the floder name, it works.
Ending
hope these details can help you.
@zheintzleman commented on GitHub (Jun 10, 2025):
Also make sure you haven't named any local files "clip.py"