复写教程中cv下ResNet报错:通道数与过滤器报错
收藏
详细报错信息:ValueError: (InvalidArgument) The number of input's channels should be equal to filter's channels * groups for Op(Conv). But received: the input's channels is 64, the input's shape is [10, 64, 56, 56]; the filter's channels is 256, the filter's shape is [256, 256, 1, 1]; the groups is 1, the data_format is NCHW. The error may come from wrong data_format setting.
报错信息翻译:ValueError: (InvalidArgument) 输入的通道数应等于过滤器的通道数 * Op(Conv) 的组数。 但是收到:输入的通道是256,输入的形状是[10,256,56,56]; 过滤器的通道数为 64,过滤器的形状为 [64, 64, 3, 3]; 组为 1,data_format 为 NCHW。 该错误可能来自错误的 data_format 设置。
暂时怀疑报错位置代码:
DeepGeGe
已解决
4#
回复于2022-01
这就是你模块之间特征图通道数对不上啊,复现resnet可以去看看这个吧:https://blog.csdn.net/qq_24178985/article/details/119810781
0
收藏
请登录后评论
补充怀疑位置代码
补充
这就是你模块之间特征图通道数对不上啊,复现resnet可以去看看这个吧:https://blog.csdn.net/qq_24178985/article/details/119810781
应该是特征图的通道数和滤波器的通道数不对,比如你特征图是 [64 256 56 56] 滤波器就必须是[64, x, x, x, x] 64和64对应
上一层的输出通道数和本层的输入通道数要保持一致
感谢,多写了一个参数,导致的
谢谢,conv0里多写了一个参数
你好,请问你是在cov0里面多写了一个什么参数