facebookresearch / jepa

PyTorch code and models for V-JEPA self-supervised learning from video.
Other
2.68k stars 254 forks source link

KeyError when running evals.main #43

Open JPerAsperaadAstra opened 8 months ago

JPerAsperaadAstra commented 8 months ago

Thanks for your brilliant work! Having downloaded K400 pretrained checkpoint file(k400-probe.pth.tar) and modified the config yaml file for the corresponding dataset(specifying datapath), I ran evals.main, and got the KeyError saying: jepa/evals/video_classification_frozen/eval.py", line 424, in load_pretrained pretrained_dict = checkpoint[checkpoint_key] KeyError: 'target_encoder Then I print the keys in checkpoint, and get the following keys: keys in ckpt: ['classifier', 'opt', 'scaler', 'epoch', 'batch_size', 'world_size', 'lr'] It seems that there's no key named "target_encoder". What's the reason behind this error? Looking forward to your reply

HaoranZhuExplorer commented 8 months ago

I think you get this issue mainly because you load the wrong checkpoint. To run this script, you need to set the checkpoint as the pretrained backbone in config file instead of loading attentive probing head.