google-research/l2p

Using different ViT and ResNet based models in L2P

prateeky2806 opened this issue · 1 comments

Hi, thank you for the great work! I was trying to get the some results on CIFAR100 dataset with a resnet18 model and a ViT-Small model. as mentioned in the readme, I was looking at the config file cifar100_l2p.py and finding appropriate changes to make.

For the ViT-S model, I tried to change the config.model_name = "ViT-S_16" as mentioned in the vit.py file and then used the command python main.py --my_config configs/cifar100_l2p.py --workdir=./l2p --my_config.init_checkpoint=./ViT-S_16.npz where the file ViT-S_16.npz is downloaded from here. When I do this I get some error regarding the shape mismatch. Can you please point me to the place where I can download the ViT-S_16 model checkpoint?

For the experiments with resnet18, I see that the file resnet_v1.py has a model resnet18_cifar. I changed the config.model_name = "resnet18_cifar" and ran the command python main.py --my_config configs/cifar100_l2p.py --workdir=./l2p and got the error

  File "main.py", line 64, in <module>
    app.run(main)
  File "/mnt/efs/people/ptky/miniconda3/envs/l2p/lib/python3.7/site-packages/absl/app.py", line 308, in run
    _run_main(main, args)
  File "/mnt/efs/people/ptky/miniconda3/envs/l2p/lib/python3.7/site-packages/absl/app.py", line 254, in _run_main
    sys.exit(main(argv))
  File "main.py", line 58, in main
    train_continual.train_and_evaluate(FLAGS.my_config, FLAGS.workdir)
  File "/mnt/efs/people/ptky/project/repos/l2p/train_continual.py", line 975, in train_and_evaluate
    config.model_name)
  File "/mnt/efs/people/ptky/project/repos/l2p/models/vit.py", line 698, in create_original_vit
    raise ValueError(f'Model {name} does not exist.')
ValueError: Model resnet18_cifar does not exist.

I would be really grateful, if you can please point me to the correct checkpoints to download, the changes that are required to be made in the config file, and the corresponding command.

Thanks,
Prateek

Hi, I could get the ViT-S model to work with the file downloaded from here.
Can you please help me with the experiments where ResNet is used as the backbone?