运行caffe出现"shapeequals(proto) shape mismatch (reshape not set)"的可能原因即解决方法

时间:2022-01-11 10:58:04

在运行caffe的过程中出现过几次这个错误,当时都是解决了就每管它了,今天再出现,决定记录下可能原因以及解决方法:

检查定位到blob中的455,发现可能是 N C H W中某个出错.

1 在做finetune时,需要确保网络的crop一致,比如,比如好多用ImageNet的网络裁剪尺寸就不同,比如AlexNet中是227,而到了 VGGNet中则变成了224,这样的细微差别只能细心查验了.

2 利用训练好的model来做predict,

input_dim: 10
input_dim
: 3
input_dim
: 64
input_dim
: 64
要注意原始的deploy中,预测图片张数为多少


3 如果不是以上原因,请尝试:在net.cpp中的742行设置kReshape = true

本文参考链接:https://github.com/BVLC/caffe/issues/2834

http://*.com/questions/30761433/caffe-check-failed-shapeequalsproto-shape-mismatch-reshape-not-set

https://groups.google.com/forum/#!topic/caffe-users/riTWI6nlIJ4