CLIP icon indicating copy to clipboard operation
CLIP copied to clipboard

'clip' has no attribute 'load'

Open nitrocon opened this issue 1 year ago • 4 comments

hi, I am quite new to python but I installed pytorch in a enviroment from python 309, using powershell in win10

I did not edit youre example code from the git page, even wothout any image in the folder this happens this is the error I get when performing the code:

Traceback (most recent call last): File "D:\Arbeitszimmer\Projekte\Tensorflow\CLIP\myclip.py", line 7, in model, preprocess = clip.load("ViT-B/32", device=device) AttributeError: module 'clip' has no attribute 'load'

pip list: Package Version


certifi 2022.12.7 charset-normalizer 3.0.1 clip 0.2.0 idna 3.4 numpy 1.24.2 Pillow 9.4.0 pip 23.0.1 requests 2.28.2 setuptools 49.2.1 torch 1.7.1+cu110 typing_extensions 4.5.0 urllib3 1.26.14

missing torchaudio and torchvision (???)

nitrocon avatar Feb 22 '23 04:02 nitrocon

You probably accidentally installed the clip package from PyPI, a package entirely unrelated to OpenAI CLIP: "Clip is a command-line interface (CLI) tool that allows you to store and quickly access text snippets and manage your clipboard."

To remove it, type pip uninstall clip.

Then follow the installation instructions in the README to install OpenAI's CLIP.

Rijgersberg avatar Feb 22 '23 09:02 Rijgersberg

oh man, we have to train chatGPT then :D :D So how do I install clip then?

Thanks for youre answer!

nitrocon avatar Feb 22 '23 14:02 nitrocon

You're probably looking for this line from the README:

pip install git+https://github.com/openai/CLIP.git

bartbroere avatar Feb 22 '23 18:02 bartbroere

got it, thanks for this...its a hard way to got until you have the first model :D

nitrocon avatar Feb 23 '23 18:02 nitrocon