eric-ai-lab / CPL

Official implementation of our EMNLP 2022 paper "CPL: Counterfactual Prompt Learning for Vision and Language Models"
MIT License
32 stars 5 forks source link

KeyError: 'classname' #8

Closed xuxu-g closed 1 year ago

xuxu-g commented 1 year ago

I'm very interested in your work and trying to reproduce the experiment results, but I have encountered one problem: when l run
python train_cf.py --root ./data --seed 1 --trainer CoCoOpcf --dataset-config-file ./configs/datasets/food101.yaml --config-file ./configs/trainers/CoCoOp/vit_b16_c4_ep10_batch1_ctxv1.yaml --output-dir output_cpl DATASET.NUM_SHOTS 1 l would get the error as follows:

../CPL/CPL/trainers/cocoopcf.py", line 371, in parse_batch_train
    classname = batch["classname"]
KeyError: 'classname' 

What can l do to solove this problem? It would be much appreciated if you can help.