d-li14 / efficientnetv2.pytorch

PyTorch implementation of EfficientNetV2 family
https://arxiv.org/abs/2104.00298
MIT License
460 stars 93 forks source link

Error of CIFAR10 Dataset #10

Closed ZhengHui-Z closed 3 years ago

ZhengHui-Z commented 3 years ago

The code cannot run on the CIFAR10 dataset because the image size of CIFAR10 is 32*32 and an error will be reported if the input dimension is (1, 3, 32, 32)

KelvinYang0320 commented 3 years ago

@ZhengHui-Z Hello, I think their code is fine. The error you mentioned is about (N, C, H, W)=(1, 3, 32, 32), but batch norm expects more then 1 value to calculate the running mean and std of the current batch. Check this link. You can change the batch size (N) to more than 1, or set model.eval(). I have run their code on CIFAR10 and everything works as expected. Hope this helps!

ZhengHui-Z commented 3 years ago

Excellent advice