jiazhou-garland / EventBind

[ECCV 2024] Official implementation of the paper "EventBind: Learning a Unified Representation to Bind Them All for Event-based Open-world Understanding".
MIT License
24 stars 0 forks source link

AboutLoad_Path #8

Closed Hotpottttt closed 1 month ago

Hotpottttt commented 1 month ago

I have a question about the Load_Path. I filled up the Load_Path as follows: Load_Path: 'MINIST ViT-B-32.bin', and the MINIST ViT-B-32.bin is the file I downloaded in your main page But when I run the code and it cause an error :

RuntimeError: Error(s) in loading state_dict for DataParallel:
        Missing key(s) in state_dict: "module.prompt_leranable.ctx, ...." 

Does anybody know what step I did wrong? I am not familiar with the checkpoints files with '.bin' as the suffix format

Hotpottttt commented 1 month ago

I also tried this: state_dict = torch.load('MINIST ViT-B-32.bin', map_location='cuda:0') print(state_dict.keys()) and I got the result: odict_keys(['module.prompt_init.ctx', 'module.prompt_init.clip_model.positional_embedding', 'module.prompt_init.clip_model.text_projection', 'module.prompt_init.clip_model.logit_scale', 'module.prompt_init.clip_model.visual.class_embedding', 'module.prompt_init.clip_model.visual.positional_embedding', 'module.prompt_init.clip_model.visual.proj and so on'

jiazhou-garland commented 1 month ago

Modify the configuration file for the N-MNIST dataset, namely, set the option config['MODEL']['TextEncoder']['learnable_ctx'] to False

Hotpottttt commented 1 month ago

Thank you! It works. But another error occurs when enumerate(dataloader): FileNotFoundError: Caught FileNotFoundError in DataLoader worker process 0. FileNotFoundError: [Errno 2] No such file or directory: '/N-MNIST/Train/5/33034.bin' But I follow the exact instruction to download the NMNIST dataset and I verify its path which is correct. Besides, I think I already set the N-MNIST.yaml all right as follow: Dataset: pad_frame_255: True num_events: 1000 median_length: 5000 Num_frame: 5 Input_size: [224,224] resize_width: 224 resize_height: 224 Representation: 'rgb' # mlp_learned, frame, gray_scale, rgb Train: Path: 'Dataloader/MINIST/N_MINIST_Train.txt' # TODO Batch_size: 60 Augmentation: True Val: Path: 'Dataloader/MINIST/N_MINIST_Val.txt' # TODO Batch_size: 500 Augmentation: False Classnames: 'Dataloader\MINIST\NMINIST_classnames.json' # TODO Imagenet_dict_path: '' N-imagenet-val: '' Sorry to bother you again!

jiazhou-garland commented 1 month ago

Modify your N_MINIST_Train.txt and N_MINIST_Val.txt file to your own dataset path.