sail-sg / iFormer

iFormer: Inception Transformer

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

missing iformer_small

sullivantee opened this issue · comments

when running valid.py it shows this error
Traceback (most recent call last):
File "validate.py", line 371, in
main()
File "validate.py", line 358, in main
validate(args)
File "validate.py", line 156, in validate
model = create_model(
File "C:\Users\CHU001\anaconda3\envs\pytorch\lib\site-packages\timm\models\factory.py", line 71, in create_model
raise RuntimeError('Unknown model (%s)' % model_name)
RuntimeError: Unknown model (iformer_small)

the code i ran:
python validate.py ./imagenet --model iformer_small --checkpoint checkpoint/iformer_small/model_best.pth.tar

i found out it grabs the model "iformer_small" from the directory of anaconda3\envs\pytorch\lib\site-packages\timm\models
but there seems to be no such model as "iformer_small"

我也有同样的问题,当我在运行finetune或者validation时显示RuntimeError: Unknown model (iformer_small)

我也是遇到了这个问题,我运行finetune时显示没有这个模型RuntimeError: Unknown model (iformer_small)

@sullivantee @aulaywang @ArptPlank

  • Step 1
    Add this line from models.inception_transformer import * at the top of validate.py.
  • Step 2
    Uncomment the code below and replace it with the following code:

create model

model = create_model(
    args.model,
    pretrained=args.pretrained,
    num_classes=args.num_classes,
    in_chans=3,
    global_pool=args.gp,
    scriptable=args.torchscript,
    mem_index=args.mem_idx,
    K=args.K)

replace to ....
model = iformer_small(pretrained="./checkpoint/iformer_small/model_best.pth")