RuntimeError: Given input size: (10x2x2). Calculated output size: (10x-7x-7). Output size is too small at /opt/conda/conda-bld/pytorch_1535491974311/work/aten/src/THCUNN/generic/
SpatialAveragePooling.cu:63
解决方法:将最后一层 nn.AvgPool2d(class_num, stride=1)
改为:
nn.AvgPool2d(class_num)
解决,这个应该是pytorch1.1的bug.