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 42 forks source link

How to change the directory where checkpoints are loaded? #39

Closed SHIBOYA closed 10 months ago

SHIBOYA commented 10 months ago

I am currently using the pre-trained checkpoint for testing purposes, and during this process, I notice the message "Initialize tensorboard (log_dir=output/base2new/train_base/caltech101/shots_16/CoCoOp/vit_b16_c4_ep10_batch1_ctxv1/seed1/tensorboard)" being printed. I am interested in modifying the checkpoint source in the file directory. Could you kindly guide me on which .py file I should be looking into to make this change?

Thank you very much for your time and assistance. I am looking forward to your guidance.

muzairkhattak commented 10 months ago

Hi @SHIBOYA,

Thank you for showing interest in MaPLe!

Regarding your query, you can change the path of the checkpoint source by modifying the MODEL_DIR variable in the testing shell script located here..

Once you have configured the MODEL_DIR, your code will search for the model weights in that directory and perform the evaluation accordingly.

I hope your query get resolved now. Please let us know in-case there is any additional question!

Thank you and kind regards!

SHIBOYA commented 10 months ago

I hope this email finds you well. First of all, thank you for your previous guidance on changing the MODEL_DIR to configure the checkpoint source in MaPLe. It was very helpful and much appreciated.

As I continue to work with MaPLe, I have come across another issue that I would like to bring to your attention. Specifically, I noticed a discrepancy in the dimensions of token_suffix and token_prefix between the Base-to-Novel and Cross-dataset Evaluation scenarios.

In the Base-to-Novel scenario, the dimensions of token_prefix and token_suffix are ([50, 1, 512]) and ([50, 74, 512]), whereas in the Cross-dataset Evaluation scenario, they are ([397, 1, 512]) and ([397, 74, 512]). I'm wondering if you could shed some light on the following questions: What is the reason behind this dimension mismatch between the two scenarios? Is this an expected behavior, or should I be concerned about a potential issue? Are there specific settings or parameters I should consider when switching between these two scenarios?

Your insights would be invaluable for my ongoing research. I look forward to hearing from you soon.

muzairkhattak commented 10 months ago

Hi @SHIBOYA,

Regarding your query, please note that the first dimension of the tensor (which is 50 in the first case and 397 in the second case) corresponds to the number of classes present in the dataset. 397 corresponds to the SUN397 dataset while 50 could be the dimensions for the case of caltech dataset (in base-to-novel).

So in summary, you do not need to be concerned about this. Thank you!

SHIBOYA commented 10 months ago

Thank you for your prompt and clear response. Your explanation regarding the first dimension of the tensor corresponding to the number of classes in the dataset clarifies the discrepancy I observed. I appreciate the time you took to address my query.

Thank you once again for your help.