CreamNuts / Fair-Comparison-between-Efficient-Attentions

4 stars 0 forks source link

Model names to test code on another dataset? #2

Closed gowtham1997 closed 2 years ago

gowtham1997 commented 2 years ago

Hello,

Thanks for this fantastic work.

I was looking at your wandb to use similar models on another dataset but seems that the model_names like stage_tiny_lin_p7, stage_tiny_swin_p7, etc arent timm models(?) ( I get TypeError: __init__() got an unexpected keyword argument 'pretrained_cfg' when I use these names)

Can you let us know the list of model names to use to test all these different architectures on another dataset?

CreamNuts commented 2 years ago

Thanks for your interest.

stage_tiny_something_p7 is my custom model so they are not in timm model. They are in the models of the repo. I have a plan to deploy my pretrained weights. So if you want to use, please wait or train the model in ImageNet-1k by using the repo.

gowtham1997 commented 2 years ago

Thanks for your prompt reply.

They are in the models of the repo.

How should I go about training these custom models on some other dataset?

python train.py ..\medical_mnist\ --model stage_tiny_lin_p4 --amp

^ for eg, I tried this on medical mnist to test and it gives me the following traceback.

Training with a single process on 1 GPUs.
Traceback (most recent call last):
  File "project\Fair-Comparison-between-Efficient-Attentions\train.py", line 1428, in <module>
    main()
  File "project\Fair-Comparison-between-Efficient-Attentions\train.py", line 854, in main
    model = create_model(
  File "D:\miniconda\envs\efficient\lib\site-packages\timm\models\factory.py", line 71, in create_model
    model = create_fn(pretrained=pretrained, pretrained_cfg=pretrained_cfg, **kwargs)
  File "project\Fair-Comparison-between-Efficient-Attentions\models\linformer.py", line 78, in stage_tiny_lin_p4
    model = StageTransformer(partial(Block, attn_layer=LinAttention), **cfg)
  File "project\Fair-Comparison-between-Efficient-Attentions\models\base.py", line 309, in __init__
    layer = BasicLayer(
  File "project\Fair-Comparison-between-Efficient-Attentions\models\base.py", line 189, in __init__
    [
  File "project\Fair-Comparison-between-Efficient-Attentions\models\base.py", line 190, in <listcomp>
    block(
  File "project\Fair-Comparison-between-Efficient-Attentions\models\base.py", line 93, in __init__
    self.attn = attn_layer(
TypeError: __init__() got an unexpected keyword argument 'pretrained_cfg'
gowtham1997 commented 2 years ago

Can you also let me know the timm version you used to test this?

I used the instructions in the repo to create the conda env, but I feel this could still be an issue with the library version of timm ?

CreamNuts commented 2 years ago

I guess so too. I check the version, and it is timm=0.5.4.

If you have a problem despite using that version, please notice. Thank you!

gowtham1997 commented 2 years ago

Seems to work now Thanks