[GH-ISSUE #317] Model has been downloaded but the SHA256 checksum does not not match #273

Closed
opened 2026-10-31 21:13:16 +00:00 by bsakaguchi · 4 comments
Owner

Originally created by @Osub on GitHub (Jan 27, 2023).
Original GitHub issue: https://github.com/openai/CLIP/issues/317

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
Originally created by @Osub on GitHub (Jan 27, 2023). Original GitHub issue: https://github.com/openai/CLIP/issues/317 ``` 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 ```
Author
Owner

@jongwook commented on GitHub (Jan 27, 2023):

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

github.com/openai/CLIP@3702849800/clip/clip.py (L31-L39)

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

<!-- gh-comment-id:1406110405 --> @jongwook commented on GitHub (Jan 27, 2023): It's likely that an unstable network connection or a firewall have caused an incomplete download. Check if these URLs are accessible manually: https://github.com/openai/CLIP/blob/3702849800aa56e2223035bccd1c6ef91c704ca8/clip/clip.py#L31-L39 If it was a temporary connection issue, retrying it will probably work.
Author
Owner

@jaded0 commented on GitHub (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.

<!-- gh-comment-id:1576194899 --> @jaded0 commented on GitHub (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.
Author
Owner

@rickyyyxu commented on GitHub (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)
<!-- gh-comment-id:1646574597 --> @rickyyyxu commented on GitHub (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) ```
Author
Owner

@smlynarczyk commented on GitHub (Feb 7, 2024):

@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 !

<!-- gh-comment-id:1932401268 --> @smlynarczyk commented on GitHub (Feb 7, 2024): @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 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#273
No description provided.