Randl / MobileNetV2-pytorch

Impementation of MobileNetV2 in pytorch
https://arxiv.org/abs/1801.04381
MIT License
271 stars 83 forks source link

RuntimeError: Output size is too small #2

Closed hhlgithub closed 6 years ago

hhlgithub commented 6 years ago

Thank you very much for modifying last bugs. It has benefited me a lot. But when I input following codes: model = MobileNet2(in_channels=2, num_classes=10) print (model) x = torch.autograd.Variable(torch.randn(1, 2, 20, 224)) print(model(x)) I encounter such errors : RuntimeError: Given input size: (1280x1x7). Calculated output size: (1280x0x1). Output size is too small at /opt/conda/conda-bld/pytorch-cpu_1518281700712/work/torch/lib/THNN/generic/SpatialAveragePooling.c:64

Randl commented 6 years ago

Input size is assumed to be 224x224