[GH-ISSUE #67] Non-jit version model archive #61

Closed
opened 2026-10-31 21:10:23 +00:00 by bsakaguchi · 2 comments
Owner

Originally created by @LucasWangZH on GitHub (Mar 23, 2021).
Original GitHub issue: https://github.com/openai/CLIP/issues/67

Hi,

do you have a non-jit version model archive. To get a non-jit version model by fetching state_dict from the current jit version model archive would encounter following problem:

D:\anaconda3\envs\torch171\python.exe D:/code/CLIP-main/main.py
Traceback (most recent call last):
File "D:/code/CLIP-main/main.py", line 16, in
model = clip.load(name,device,jit=False)
File "D:\code\CLIP-main\clip\clip.py", line 114, in load
model = build_model(state_dict or model.state_dict()).to(device)
File "D:\code\CLIP-main\clip\model.py", line 431, in build_model
model.load_state_dict(state_dict)
File "D:\anaconda3\envs\torch171\lib\site-packages\torch\nn\modules\module.py", line 1051, in load_state_dict
raise RuntimeError('Error(s) in loading state_dict for {}:\n\t{}'.format(
RuntimeError: Error(s) in loading state_dict for CLIP:
size mismatch for logit_scale: copying a param with shape torch.Size([]) from checkpoint, the shape in current model is torch.Size([1]).

Originally created by @LucasWangZH on GitHub (Mar 23, 2021). Original GitHub issue: https://github.com/openai/CLIP/issues/67 Hi, do you have a non-jit version model archive. To get a non-jit version model by fetching state_dict from the current jit version model archive would encounter following problem: D:\anaconda3\envs\torch171\python.exe D:/code/CLIP-main/main.py Traceback (most recent call last): File "D:/code/CLIP-main/main.py", line 16, in <module> model = clip.load(name,device,jit=False) File "D:\code\CLIP-main\clip\clip.py", line 114, in load model = build_model(state_dict or model.state_dict()).to(device) File "D:\code\CLIP-main\clip\model.py", line 431, in build_model model.load_state_dict(state_dict) File "D:\anaconda3\envs\torch171\lib\site-packages\torch\nn\modules\module.py", line 1051, in load_state_dict raise RuntimeError('Error(s) in loading state_dict for {}:\n\t{}'.format( RuntimeError: Error(s) in loading state_dict for CLIP: size mismatch for logit_scale: copying a param with shape torch.Size([]) from checkpoint, the shape in current model is torch.Size([1]).
Author
Owner

@jongwook commented on GitHub (Mar 23, 2021):

Hi, there was a temporary bug (#66) regarding this earlier today. Does it still happen with the latest commit github.com/openai/CLIP@8a665a683d?

<!-- gh-comment-id:804738882 --> @jongwook commented on GitHub (Mar 23, 2021): Hi, there was a temporary bug (#66) regarding this earlier today. Does it still happen with the latest commit https://github.com/openai/CLIP/commit/8a665a683d791ed3491fedadcb3c91878f9eb78d?
Author
Owner

@LucasWangZH commented on GitHub (Mar 23, 2021):

Great! The bug is gone with the latest commit.

<!-- gh-comment-id:804740312 --> @LucasWangZH commented on GitHub (Mar 23, 2021): Great! The bug is gone with the latest commit.
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#61
No description provided.