muzairkhattak / multimodal-prompt-learning

[CVPR 2023] Official repository of paper titled "MaPLe: Multi-modal Prompt Learning".
https://muzairkhattak.github.io/multimodal-prompt-learning/
MIT License
578 stars 43 forks source link

Question about reproduce_maple.sh #43

Closed HaoliangZhou closed 7 months ago

HaoliangZhou commented 8 months ago

Hello! I have a question, please. When run the evaluation script scripts/maple/reproduce_maple.sh, what path shoud be right, "MaPLe/output/base2new/train_base/caltech101/shots_16/MaPLe/vit_b16_c2_ep5_batch4_2ctx/seed1/MultiModalPromptLearner" or "MaPLe/output/base2new/train_base/caltech101/" or both are wrong?

because when i use the command "CUDA_VISIBLE_DEVICES=6 bash scripts/maple/reproduce_maple.sh oxford_flower 1 MaPLe/output/base2new/train_base/oxford_flower/shots_16/MaPLe/vit_b16_c2_ep5_batch4_2ctx/seed1/MultiModalPromptLearner" there will report such errors :

Traceback (most recent call last): File "train.py", line 245, in main(args) File "train.py", line 183, in main trainer.load_model(args.model_dir, epoch=args.load_epoch) File "MaPLe/trainers/maple.py", line 318, in load_model raise FileNotFoundError('Model not found at "{}"'.format(model_path)) FileNotFoundError: Model not found at "MaPLe/output/base2new/train_base/oxford_flowers/shots_16/MaPLe/vit_b16_c2_ep5_batch4_2ctx/seed1/MultiModalPromptLearner/base/seed1/MultiModalPromptLearner/model.pth.tar-5"

muzairkhattak commented 8 months ago

Hi @HaoliangZhou,

Thank you for showing interest in MaPLe!

Regarding your query, please note that you only need to give the path to the folder where you have downloaded the pretrained weights.

For example, if you have downloaded imagenet weight folder imagenet, then you should provide path which points to that imagenetfolder.

You do not need to provide the extra path such as MaPLe/output/base2new/train_base/oxford_flower/shots_16/MaPLe/vit_b16_c2_ep5_batch4_2ctx/seed1/MultiModalPromptLearner as our code will append this automatically.

I hope this will resolve you issue.

Kind regards, Muhammad Uzair

HaoliangZhou commented 7 months ago

Thank you very much!