marmot-xy / CMBS

cross modal background suppression for audio-visual event localization
35 stars 6 forks source link

too many indices for tensor of dimension 0 #2

Closed WindBlowMyAss closed 1 year ago

WindBlowMyAss commented 1 year ago

Hey bro, I found that issue when I try to recurrent your result in weakly training settings.To be specific, it's a data error when event_class.shape not equal to [16] in weakly_main.py, which the shape of pred is[16, 20]. What should I do to fix this? Thanks a lot. 803949726f42e5aca012014172bcb70

marmot-xy commented 1 year ago

Sorry bro, you provided so little information that I can't quite figure out what's wrong. Have you made any changes to the code? Because the original code can run normally. FYI, the shape of pred in my code is [16, 10], where 16 is the batch size, 10 is the length, I do not know why yours is [16, 20]? When the event_class.shape not equal to [16], for example, the event_class.shape is [2], the shape of pred is also [2, 10], so the shapes are equal.

WindBlowMyAss commented 1 year ago

Sorry bro, you provided so little information that I can't quite figure out what's wrong. Have you made any changes to the code? Because the original code can run normally. FYI, the shape of pred in my code is [16, 10], where 16 is the batch size, 10 is the length, I do not know why yours is [16, 20]? When the event_class.shape not equal to [16], for example, the event_class.shape is [2], the shape of pred is also [2, 10], so the shapes are equal.

Thanks a lot for your repliement! I carefully examine the whole data and don't make any changes to your code, but the error still occurs when the shape of 'event_class' and 'pred' changes to [] and [20] e1a6461ee13d2246c53f0e627b932a5 suddenly.

marmot-xy commented 1 year ago

Sorry, I can not figure out why this error is happened in your project. I just rerun my weakly_train.py code and it seems OK.