video-classification icon indicating copy to clipboard operation
video-classification copied to clipboard

error batch norm

Open babbu3682 opened this issue 4 years ago • 2 comments

When I enter inputs to the CNN model, there is an error in the batch norm layer because the forward() make a batch size of 1. How did you solve this?

The error is as follows: ValueError: Expected more than 1 value per channel when training, got input size torch.Size([1, 1024])

And when you do DataParallel, there is an error. How did you fix it?

babbu3682 avatar May 01 '20 02:05 babbu3682

As far as I know it, this is probably because the samples you put may be too few. Just increase the sample size and this error should go away. This error is likely due to the design batchnorm of the PyTorch. Let me know if this error persists.

HHTseng avatar May 01 '20 02:05 HHTseng

Thanks!! It is solved. but I have another problem with the Encoder model. I wanted to make the CRNN from scratch so I build my custom CNN encoder model like Efficientnet-b0, it is worked but after 2 step the memory errors show up. I think gpu memory is stacked every step because of for(). So, how can you solve that problem?

babbu3682 avatar May 06 '20 08:05 babbu3682