tuyunbin / SCORER

[ICCV 2023] This is the Pytorch code for our paper "Self-Supervised Cross-View Representation Reconstruction for Change Captioning".
14 stars 1 forks source link

Vocabulary file not found: No such file or directory: './data/transformer_vocab.json' #1

Closed matthewdm0816 closed 7 months ago

matthewdm0816 commented 7 months ago

I'm trying to train the model with the given command python train.py --cfg configs/dynamic/transformer.yaml, but an error occurs. The error message is like: (last few lines)

  File "/hd1/mwt/SCORER/datasets/rcc_dataset_transformer.py", line 39, in __init__
    self.word_to_idx = json.load(open(self.vocab_json, 'r'))
FileNotFoundError: [Errno 2] No such file or directory: './data/transformer_vocab.json'

Seems a configuration error, I see vocab.json in the ./data directory, is that the correct file to use?

tuyunbin commented 7 months ago

Please use this command: python scripts/preprocess_captions_transformer.py --input_captions_json ./data/change_captions.json --input_neg_captions_json ./data/no_change_captions.json --input_image_dir ./data/images --split_json ./data/splits.json --output_vocab_json ./data/transformer_vocab.json --output_h5 ./data/transformer_labels.h5

matthewdm0816 commented 7 months ago

Thanks!