标签:tps sel issues generic pool time 预训练模型 二层 average
调用预训练模型ResNet18时报错:RuntimeError: Given input size: (512x3x3). Calculated output size: (512x-3x-3).
Output size is too small at /opt/conda/conda-bld/pytorch_1535491974311/work/aten/src/THCUNN/generic/
SpatialAveragePooling.cu:63
其解决方法是将倒数第二层的self.avgpool = nn.AdaptiveAvgPool2d((1, 1))替换为
self.avgpool = nn.AdaptiveAvgPool2d(1)即可。具体原因可能是一个bug.
参考:https://github.com/pytorch/vision/issues/696
迁移学习调用预训练模型出现Given input size: (512x3x3). Calculated output size: (512x-3x-3)错误
标签:tps sel issues generic pool time 预训练模型 二层 average
原文地址:https://www.cnblogs.com/dyclown/p/12587390.html