Skip to content

Model has been downloaded but the SHA256 checksum does not not match #317

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Osub opened this issue Jan 27, 2023 · 4 comments
Closed

Model has been downloaded but the SHA256 checksum does not not match #317

Osub opened this issue Jan 27, 2023 · 4 comments

Comments

@Osub
Copy link

Osub commented Jan 27, 2023

Traceback (most recent call last):
  File "/Users/nft/Desktop/work/aphantasia/clip_fft.py", line 319, in <module>
    main()
  File "/Users/nft/Desktop/work/aphantasia/clip_fft.py", line 119, in main
    model_clip, _ = clip.load(a.model, jit=old_torch())
  File "/Users/nft/miniforge3/lib/python3.9/site-packages/clip/clip.py", line 120, in load
    model_path = _download(_MODELS[name], download_root or os.path.expanduser("~/.cache/clip"))
  File "/Users/nft/miniforge3/lib/python3.9/site-packages/clip/clip.py", line 70, in _download
    raise RuntimeError("Model has been downloaded but the SHA256 checksum does not not match")
RuntimeError: Model has been downloaded but the SHA256 checksum does not not match
@jongwook
Copy link
Collaborator

It's likely that an unstable network connection or a firewall have caused an incomplete download. Check if these URLs are accessible manually:

CLIP/clip/clip.py

Lines 31 to 39 in 3702849

"RN50": "https://openaipublic.azureedge.net/clip/models/afeb0e10f9e5a86da6080e35cf09123aca3b358a0c3e3b6c78a7b63bc04b6762/RN50.pt",
"RN101": "https://openaipublic.azureedge.net/clip/models/8fa8567bab74a42d41c5915025a8e4538c3bdbe8804a470a72f30b0d94fab599/RN101.pt",
"RN50x4": "https://openaipublic.azureedge.net/clip/models/7e526bd135e493cef0776de27d5f42653e6b4c8bf9e0f653bb11773263205fdd/RN50x4.pt",
"RN50x16": "https://openaipublic.azureedge.net/clip/models/52378b407f34354e150460fe41077663dd5b39c54cd0bfd2b27167a4a06ec9aa/RN50x16.pt",
"RN50x64": "https://openaipublic.azureedge.net/clip/models/be1cfb55d75a9666199fb2206c106743da0f6468c9d327f3e0d0a543a9919d9c/RN50x64.pt",
"ViT-B/32": "https://openaipublic.azureedge.net/clip/models/40d365715913c9da98579312b702a82c18be219cc2a73407c4526f58eba950af/ViT-B-32.pt",
"ViT-B/16": "https://openaipublic.azureedge.net/clip/models/5806e77cd80f8b59890b7e101eabd078d9fb84e6937f9e85e4ecb61988df416f/ViT-B-16.pt",
"ViT-L/14": "https://openaipublic.azureedge.net/clip/models/b8cca3fd41ae0c99ba7e8951adf17d267cdb84cd88be6f7c2e0eca1737a03836/ViT-L-14.pt",
"ViT-L/14@336px": "https://openaipublic.azureedge.net/clip/models/3035c92b350959924f9f00213499208652fc7ea050643e8b385c2dac08641f02/ViT-L-14-336px.pt",

If it was a temporary connection issue, retrying it will probably work.

@jaded0
Copy link

jaded0 commented Jun 5, 2023

In my case, the problem is happening repeatedly. I feel like the issue is deeper, because I've never had problems with an unstable connection completely aborting downloads like this.

@coasxu
Copy link

coasxu commented Jul 22, 2023

In my case, when I encountered this error for the first time, I reran the code below again and there was no error.

import torch
import clip
from PIL import Image

device = "cuda" if torch.cuda.is_available() else "cpu"
model, preprocess = clip.load("ViT-B/32", device=device)

image = preprocess(Image.open("CLIP.png")).unsqueeze(0).to(device)
text = clip.tokenize(["a diagram", "a dog", "a cat"]).to(device)

@smlynarczyk
Copy link

@jongwook's suggestion worked for my whisper issue. I had to create the $HOME/.cache/clip directory and then download the ViT.*pt files into it. Thanks @jongwook !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants