caffe
caffe copied to clipboard
[PReLU Test] Check failed: target_blobs.size() == source_layer.blobs_size() (1 vs. 0) Incompatible number of blobs for layer conv1/relu_7x7
when caffe training was loading, it failed with the below message,
I1118 09:29:19.723623 27879 upgrade_proto.cpp:59] Successfully upgraded file specified using deprecated V1LayerParameter F1118 09:29:19.724726 27879 net.cpp:822] Check failed: target_blobs.size() == source_layer.blobs_size() (1 vs. 0) Incompatible number of blobs for layer conv1/relu_7x7 *** Check failure stack trace: *** train_val_prelu.txt
@ 0x7f633efc8ea4 (unknown)
@ 0x7f633efc8deb (unknown)
@ 0x7f633efc87bf (unknown)
@ 0x7f633efcba35 (unknown)
@ 0x7f633f5e95ec caffe::Net<>::CopyTrainedLayersFrom()
@ 0x7f633f5f5e75 caffe::Net<>::CopyTrainedLayersFromBinaryProto()
@ 0x7f633f5f5f06 caffe::Net<>::CopyTrainedLayersFrom()
@ 0x406660 CopyLayers()
@ 0x40948c train()
@ 0x40571b main
@ 0x7f633e4c8a40 (unknown)
@ 0x405eb9 _start
@ (nil) (unknown)
(I just modified ReLU to PReLU)
train_val.prototxt
layer { name: "conv1/7x7_s2" type: "Convolution" bottom: "data" top: "conv1/7x7_s2" param { lr_mult: 1 decay_mult: 1 } param { lr_mult: 2 decay_mult: 0 } convolution_param { num_output: 64 pad: 3 kernel_size: 7 stride: 2 weight_filler { type: "xavier" } bias_filler { type: "constant" value: 0.2 } } } layer { name: "conv1/relu_7x7" type: "PReLU" bottom: "conv1/7x7_s2" top: "conv1/7x7_s2" }
Previous prototxt that is used ReLU is well training now.
layer { name: "conv1/relu_7x7" type: "ReLU" bottom: "conv1/7x7_s2" top: "conv1/7x7_s2" } How to use PReLU in recent caffe version?
I have encountered the same problem as you.Have you solved this problem?If yes,could you do me a favor and tell me?
The problem happens when i use specific initial model(model_zoo, bvlc_googlenet.caffemodel.) if I didn't use ini model, caffe normally operated. I will re open this issue.. i still not resolve this problem when i use initial model.
I0109 15:58:45.985611 20448 upgrade_proto.cpp:51] Attempting to upgrade input file specified using deprecated V1LayerParameter: /home/derek.ji/caffe/caffe_w_nc6/models/bvlc_googlenet.caffemodel I0109 15:58:46.039659 20448 upgrade_proto.cpp:59] Successfully upgraded file specified using deprecated V1LayerParameter F0109 15:58:46.040310 20448 net.cpp:822] Check failed: target_blobs.size() == source_layer.blobs_size() (1 vs. 0) Incompatible number of blobs for layer conv1/relu_7x7 *** Check failure stack trace: *** @ 0x7f53a31c1ea4 (unknown) @ 0x7f53a31c1deb (unknown) @ 0x7f53a31c17bf (unknown) @ 0x7f53a31c4a35 (unknown) @ 0x7f53a37e446c caffe::Net<>::CopyTrainedLayersFrom() @ 0x7f53a37f0cf5 caffe::Net<>::CopyTrainedLayersFromBinaryProto() @ 0x7f53a37f0d86 caffe::Net<>::CopyTrainedLayersFrom() @ 0x406670 CopyLayers() @ 0x40949c train() @ 0x40572b main @ 0x7f53a2348a40 (unknown) @ 0x405ec9 _start @ (nil) (unknown)
Hi!
I've just had this issue and solved it by renaming layers. In your example, you should simply rename "conv1/relu_7x7" and other ReLU layers to something else. This way Caffe knows that those layers will be trained from scratch and doesn't attempt transferring from the previous model.
when i want to test MobileNetv2-SSDLite using my ***.models, i encounter " Check failed: target_blobs.size() == source_layer.blobs_size() (1 vs. 0) Incompatible number of blobs for layer ***" problem, i keep the same between "deploy.prototxt" and "train.prototxt" using "bias_term: xxx"; it is working
当我使用自己训练文件(train.prototxt) 测试文件(test.prototxt) 和配置文件(deploy.prototxt) 生成权值文件后(mobilenet_iter_204000.caffemodel),去测试视频,遇到了“Check failed: target_blobs.size() == source_layer.blobs_size() (1 vs. 0) Incompatible number of blobs for layer ***” 问题,然后我仿照训练文件的内容 “bias_term: xxx” 修改了配置文件的“bias_term: xxx” 然后就可以工作了~
In my case, my relu has the same name as conv, so I change the name of relu from conv5_1/sep to relu5_1/sep , and the problem is solved.