self-attention-music-tagging icon indicating copy to clipboard operation
self-attention-music-tagging copied to clipboard

RuntimeError when executing visualize_example.ipynb

Open lenasolAI opened this issue 3 years ago • 3 comments

Hi there, I am trying to run the model on my own data. I used the 'preprocess.py' in the folder 'preprocessing/mtat' to preprocess my music files and create the melspectrogram. Afterwards I used the 'get_tensor'-function from 'vismodel.py' as indicated in the the visualize_example.ipynb notebook. This leaves me with a torch.Size([1, 96, 256]).

When trying to run the model on this tensor, I get the following error: 'RuntimeError: Given input size: (8x11x256). Calculated output size: (8x0x256). Output size is too small'

Do you have any idea how to get this problem fixed? Thank you!

lenasolAI avatar Feb 09 '22 11:02 lenasolAI

Hi,

Can you paste the code that you run and the entire error message, please?

minzwon avatar Feb 09 '22 13:02 minzwon

Thanks for your reply!

This is the code I have used:

0DFDBEDD-E826-4E4B-9F43-0BA890B2A590

And here is the entire error message:

9E8F7140-C7AD-4BFE-A151-4B5C546297F3 45CA4E36-C123-4B19-9E7B-9119EA472B06 D19A0A41-4637-4349-8D76-210BBF6A8CDC

lenasolAI avatar Feb 09 '22 17:02 lenasolAI

It looks like an issue with the input shape. Let's check the shape of the spectrogram. Can you let me know the shape of your spectrograms?

To be clearer, in this line (link), let's add one more line print(spec.shape) to confirm the shape.

minzwon avatar Feb 16 '22 03:02 minzwon