huggingface / pytorch-image-models

The largest collection of PyTorch image encoders / backbones. Including train, eval, inference, export scripts, and pretrained weights -- ResNet, ResNeXT, EfficientNet, NFNet, Vision Transformer (ViT), MobileNetV4, MobileNet-V3 & V2, RegNet, DPN, CSPNet, Swin Transformer, MaxViT, CoAtNet, ConvNeXt, and more
https://huggingface.co/docs/timm
Apache License 2.0
32.4k stars 4.77k forks source link

[BUG] tf_efficientnetv2_xl_in21k doesnt load #1120

Closed emoen closed 2 years ago

emoen commented 2 years ago

Describe the bug unable to load efficientNetV2 with xl weights

To Reproduce Steps to reproduce the behavior:

timm.create_model('tf_efficientnetv2_xl_in21k', pretrained=True, in_chans=3, num_classes=1) fails to load the model with error:


RuntimeError Traceback (most recent call last)

in ----> 1 timm.create_model('tf_efficientnetv2_xl_in21k', pretrained=True, in_chans=3, num_classes=1000) ~/.local/lib/python3.6/site-packages/timm/models/factory.py in create_model(model_name, pretrained, checkpoint_path, scriptable, exportable, no_jit, **kwargs) 76 create_fn = model_entrypoint(model_name) 77 else: ---> 78 raise RuntimeError('Unknown model (%s)' % model_name) 79 80 with set_layer_config(scriptable=scriptable, exportable=exportable, no_jit=no_jit): RuntimeError: Unknown model (tf_efficientnetv2_xl_in21k) **Expected behavior** loading large: >timm.create_model('tf_efficientnetv2_l_in21k', pretrained=True, in_chans=3, num_classes=1000) EfficientNet( (conv_stem): Conv2dSame(3, 32, kernel_size=(3, 3), stride=(2, 2), bias=False) (bn1): BatchNorm2d(32, eps=0.001, momentum=0.1, affine=True, track_running_stats=True) (act1): SiLU(inplace=True) ... (classifier): Linear(in_features=1280, out_features=1000, bias=True) ) **Desktop (please complete the following information):** - OS: centO, running jupyter
rwightman commented 2 years ago

@emoen check your version of timm, it works fine with curent master branch and pypi release. You have an old one in your environment

emoen commented 2 years ago

version I had: timm 0.4.12, new version: timm-0.5.4

ChristopherMarais commented 1 year ago

I am getting the same issue with maxvit_rmlp_base_rw_224.sw_in12k from here. I have also checked and I am using timm version 0.6.12

hhhheep commented 3 months ago

I am getting the same issue, and solved it with pip install timm --upgrade.