NeuSpeech / EEG-To-Text

72 stars 8 forks source link

Error while training | list index out of range #7

Closed Dark-knight-02 closed 6 days ago

Dark-knight-02 commented 1 week ago

train_input is: EEG [INFO]using model: BrainTranslator ![Debug]using ALL [INFO]eeg type GD [INFO]using bands ['_t1', '_t2', '_a1', '_a2', '_b1', '_b2', '_g1', '_g2'] [INFO]using device cuda:0

[INFO]loading 3 task datasets [INFO]using subjects: ['ZAB', 'ZDM', 'ZDN', 'ZGW', 'ZJM', 'ZJN', 'ZJS', 'ZKB', 'ZKH', 'ZKW', 'ZMG', 'ZPH'] train divider = 320 dev divider = 360 [INFO]initializing a train set... ++ adding task to dataset, now we have: 0 [INFO]using subjects: ['ZAB', 'ZDM', 'ZDN', 'ZGW', 'ZJM', 'ZJN', 'ZJS', 'ZKB', 'ZKH', 'ZKW', 'ZMG', 'ZPH'] train divider = 240 dev divider = 270 [INFO]initializing a train set... ++ adding task to dataset, now we have: 0 [INFO]using subjects: ['ZAB', 'ZDM', 'ZDN', 'ZGW', 'ZJM', 'ZJN', 'ZJS', 'ZKB', 'ZKH', 'ZKW', 'ZMG', 'ZPH'] train divider = 325 dev divider = 365 [INFO]initializing a train set... ++ adding task to dataset, now we have: 0 Traceback (most recent call last): File "/content/drive/MyDrive/mitacs/EEG-To-Text/train_decoding.py", line 265, in train_set = ZuCo_dataset(whole_dataset_dicts, 'train', tokenizer, subject = subject_choice, eeg_type = eeg_type_choice, bands = bands_choice, setting = dataset_setting, test_input=train_input) File "/content/drive/MyDrive/mitacs/EEG-To-Text/data.py", line 234, in init print('[INFO]input tensor size:', self.inputs[0]['input_embeddings'].size()) IndexError: list index out of range

girlsending0 commented 1 week ago

You need to check your data pikcle file. data is still not loaded

Dark-knight-02 commented 1 week ago

I tried the code and tested it. I found that this was part of the code causing the error.

There was an issue with the line sent_level_eeg_tensor = torch.from_numpy(sent_obj['sentence_level_rawEEG']) The sent_obj['sentence_level_rawEEG'] gives out a dictionary

Also the data prepared using the construct_dataset_mat_to_pickle_v1.py makes the pickle file with sent_obj['sentence_level_EEG'] which was sent_obj['sentence_level_rawEEG'] in the code of data.py (last commit)

Same with the sent_obj['word_ft'] and sent_obj['word'] keyword variation which caused an error.

girlsending0 commented 1 week ago

Thank you for notice to me. I changed the word_ft => word.

Dark-knight-02 commented 1 week ago

There needs to be a couple of changes to the code to get it running. I have made a pull request incorporating all the necessary changes. Kindly review it.

Dark-knight-02 commented 6 days ago

The issue closed with the recent merge.

NeuSpeech commented 6 days ago

thank you