RuntimeError: Unknown model (vit_base_patch16_clip_384.laion2b_ft_in12k_in1k)
Hello, anyone here.
Recently I found a project that using this model to calculate the similarity, but when I use the demo code, I meet the error below:
RuntimeError Traceback (most recent call last)
Cell In[3], line 9
3 import timm
5 img = Image.open(urlopen(
6 'https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/beignets-task-guide.png'
7 ))
----> 9 model = timm.create_model(
10 'vit_base_patch16_clip_384.laion2b_ft_in12k_in1k',
11 pretrained=True,
12 num_classes=0, # remove classifier nn.Linear
13 )
14 model = model.eval()
16 # get model specific transforms (normalization, resize)
File /usr/local/lib/python3.10/dist-packages/timm/models/factory.py:67, in create_model(model_name, pretrained, pretrained_cfg, checkpoint_path, scriptable, exportable, no_jit, **kwargs)
64 pretrained_cfg, model_name = load_model_config_from_hf(model_name)
66 if not is_model(model_name):
---> 67 raise RuntimeError('Unknown model (%s)' % model_name)
69 create_fn = model_entrypoint(model_name)
70 with set_layer_config(scriptable=scriptable, exportable=exportable, no_jit=no_jit):
RuntimeError: Unknown model (vit_base_patch16_clip_384.laion2b_ft_in12k_in1k)
Most likely have an old version of timm
Most likely have an old version of timm
thanks,I used to pip install timm==0.6.12, which is not outdate. It works after I upgrade it.
FYI timm 0.6.12 is from 2022 so it is still fairly old. 1.0.3 is current.