qiuqiangkong / audioset_tagging_cnn

MIT License
1.32k stars 249 forks source link

KeyError: 'framewise_output' #13

Closed PasNinii closed 4 years ago

PasNinii commented 4 years ago

Hi,

When I run CUDA_VISIBLE_DEVICES=0 python3 pytorch/inference.py sound_event_detection --model_type=$MODEL_TYPE --checkpoint_path=$CHECKPOINT_PATH --audio_path="resources/7061-6-0-0.wav" --cuda I got an error saying

Traceback (most recent call last):
  File "pytorch/inference.py", line 202, in <module>
    sound_event_detection(args)
  File "pytorch/inference.py", line 132, in sound_event_detection
    framewise_output = batch_output_dict['framewise_output'].data.cpu().numpy()[0]

Then if I print batch_output_dict I see that the keys are: dict_keys(['clipwise_output', 'embedding']). Am I missing something ?

Thanks

jsphweid commented 3 years ago

@PasNinii did you solve this?

moseranliunian commented 11 months ago

Hello, I also encountered the same problem when running the code, I would like to ask you how to solve it

chamecall commented 7 months ago

that happens because you're using checkpoints for models that are not supposed to predict framewise predictions. as said in here only the DecisionLevelMax (the best), DecisionLevelAvg, DecisionLevelAtt models support such type of predictions. In my turn I'm interested if maybe someone trained such a architecture for more lightweight archs (cnn10, mobilenetv*)?