ytongbai / ViTs-vs-CNNs

[NeurIPS 2021]: Are Transformers More Robust Than CNNs? (Pytorch implementation & checkpoints)
176 stars 10 forks source link

Unknown model (deit_small_patch16_224) #6

Closed natanielruiz closed 2 years ago

natanielruiz commented 2 years ago

Cannot create DeiT Small model.

I have timm=0.3.2 installed. I try to evaluate DeiT Small on ImageNet and get the following error.

[xxx@xxx vit-vs-cnn]$ CUDA_VISIBLE_DEVICES=0 python imagenet_robust.py -a 'deit_small_patch16_224' --test-batch 256  --data data_path  --evaluate --imagenet-a --ckpt ckpt/deitsmall.pth --sing singln
Traceback (most recent call last):
  File "/home/research/domain_sim/vit-vs-cnn/imagenet_robust.py", line 394, in <module>
    main()
  File "/home/research/domain_sim/vit-vs-cnn/imagenet_robust.py", line 233, in main
    model = create_model(
  File "/home/anaconda3/envs/domain2/lib/python3.9/site-packages/timm/models/factory.py", line 59, in create_model
    raise RuntimeError('Unknown model (%s)' % model_name)
RuntimeError: Unknown model (deit_small_patch16_224)
natanielruiz commented 2 years ago

Hi, any idea on why I have this problem?

natanielruiz commented 2 years ago

I have a fix: loading model from models/models.py instead.