TideDancer / interspeech21_emotion

99 stars 20 forks source link

KeyError: 'file' in prediction #16

Closed Efr0nd closed 10 months ago

Efr0nd commented 11 months ago

Thank you for providing the code! I encountered this issue while running the command 'prediction.sh output/tmp':

_File "run_emotion.py", line 599, in main() File "run_emotion.py", line 581, in main f.write(val_dataset[i]['file'].split("/")[-1] + " " + str(len(val_dataset[i]['inputvalues'])/16000) + " ") KeyError: 'file'

And I checked the keys of the val_dataset and found only 'input_value'. Why did this happen? After mapping, val_dataset[i] still has the key 'file'. It has truly been troubling me for quite a while.

I would greatly appreciate it if you could answer my question!

Efr0nd commented 11 months ago

And for this line of code:

predictions, labels, metrics = trainer.predict(val_dataset, metric_key_prefix="predict")

I found many 'Nan' in predictions, and the labels is None.

TideDancer commented 10 months ago

Sorry for the late reply. Have you solved the issue? The csv file has the field 'file' in it. If the 'file' key is not found, could you set a breakpoint after obtaining the val_dataset, https://github.com/TideDancer/interspeech21_emotion/blob/c36dcc0d2bd9a22602c081a5ab064ab5e9d4f019/run_emotion.py#L448, and see if the keys are correct ?

Efr0nd commented 10 months ago

Sorry for the late reply. Have you solved the issue? The csv file has the field 'file' in it. If the 'file' key is not found, could you set a breakpoint after obtaining the val_dataset,

https://github.com/TideDancer/interspeech21_emotion/blob/c36dcc0d2bd9a22602c081a5ab064ab5e9d4f019/run_emotion.py#L448

, and see if the keys are correct ?

Thanks for your reply! I will try that.

wlaamaa commented 5 months ago

Sorry for the late reply. Have you solved the issue? The csv file has the field 'file' in it. If the 'file' key is not found, could you set a breakpoint after obtaining the val_dataset, https://github.com/TideDancer/interspeech21_emotion/blob/c36dcc0d2bd9a22602c081a5ab064ab5e9d4f019/run_emotion.py#L448

, and see if the keys are correct ?

Thanks for your reply! I will try that.

Hello, have you solved this problem