HHTseng / video-classification

Tutorial for video classification/ action recognition using 3D CNN/ CNN+RNN on UCF101
940 stars 216 forks source link

error batch norm #24

Open babbu3682 opened 4 years ago

babbu3682 commented 4 years ago

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?

HHTseng commented 4 years ago

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.

babbu3682 commented 4 years ago

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?