fast-rcnn icon indicating copy to clipboard operation
fast-rcnn copied to clipboard

smooth_L1_loss_layer.cpp:19] Check failed: bottom.size() == 4 (3 vs. 4) If weights are used, must specify both inside and outside weights.

Open gaurav16gupta opened this issue 8 years ago • 10 comments

Hi, I am using train_net.py on VOC2007.

./tools/train_net.py --gpu 0 --solver models/CaffeNet/solver.prototxt --weights data/imagenet_models/CaffeNet.v2.caffemodel

How can I resolve this error:

smooth_L1_loss_layer.cpp:19] Check failed: bottom.size() == 4 (3 vs. 4) If weights are used, must specify both inside and outside weights

gaurav16gupta avatar May 10 '16 05:05 gaurav16gupta

Hi, I faced the same problem. Did you manage to find a solution?

dumka avatar May 12 '16 14:05 dumka

Instead of train_net.py, I have used train_faster_rcnn_alt_opt.py.

python ./tools/train_faster_rcnn_alt_opt.py --gpu 0 --net_name VGG_CNN_M_1024 --weights data/imagenet_models/VGG_CNN_M_1024.v2.caffemodel --cfg experiments/cfgs/faster_rcnn_alt_opt.yml

gaurav16gupta avatar May 23 '16 05:05 gaurav16gupta

Were you able to solve the issue. I am trying to train VOC2007 in fast-rcnn which does not have a .._alt_opt.py file. Please help.

Utsavz avatar Sep 16 '16 12:09 Utsavz

I am facing the same problem. @Stark123 Could you please explain how train_faster_rcnn_alt_opt.py solved your problem?

Lisandro79 avatar Sep 20 '16 11:09 Lisandro79

Hi guys, the real problem is probably that you used the Caffe compiled in py-faster-rcnn, and the author has changed smooth_L1_loss_layer.cpp file. So recompile the Caffe in the fast-rcnn may help to solve the problem. @Lisandro79 @Utsavz @Stark123

chenyang-charles avatar Sep 22 '16 20:09 chenyang-charles

i have meet the same problem ,it was because the different version in caffe .

LEXUSAPI avatar Apr 20 '17 06:04 LEXUSAPI

I also meet the same problem. it was caused by the caffe version that is suitable for faster-rcnn. I replace the "smooth_L1_loss_layer.cpp" and "smooth_L1_loss_layer.cu" with the same name file that is in fast-rcnn caffe

wangguojun2018 avatar Mar 12 '19 10:03 wangguojun2018

I also meet the same problem. it was caused by the caffe version that is suitable for faster-rcnn. I replace the "smooth_L1_loss_layer.cpp" and "smooth_L1_loss_layer.cu" with the same name file that is in fast-rcnn caffe

I do what you said but an error occurs.

src/caffe/layers/smooth_L1_loss_layer.cpp:8:38: fatal error: caffe/fast_rcnn_layers.hpp: No such file or directory
compilation terminated.
Makefile:572: recipe for target '.build_release/src/caffe/layers/smooth_L1_loss_layer.o' failed
make: *** [.build_release/src/caffe/layers/smooth_L1_loss_layer.o] Error 1
make: *** Waiting for unfinished jobs....

Are you sure just replacing can work?

Bachery avatar Mar 12 '19 11:03 Bachery

I also meet the same problem. it was caused by the caffe version that is suitable for faster-rcnn. I replace the "smooth_L1_loss_layer.cpp" and "smooth_L1_loss_layer.cu" with the same name file that is in fast-rcnn caffe

I do what you said but an error occurs.

src/caffe/layers/smooth_L1_loss_layer.cpp:8:38: fatal error: caffe/fast_rcnn_layers.hpp: No such file or directory
compilation terminated.
Makefile:572: recipe for target '.build_release/src/caffe/layers/smooth_L1_loss_layer.o' failed
make: *** [.build_release/src/caffe/layers/smooth_L1_loss_layer.o] Error 1
make: *** Waiting for unfinished jobs....

Are you sure just replacing can work?

我直接用中文吧,我用的是这个版本的caffe(https://github.com/nils489/caffe-fast-rcnn) faster-rcnn branch. 支持cuda 5.按照我之前说的,训练是没问题,你可以试一下

wangguojun2018 avatar Mar 12 '19 11:03 wangguojun2018

I also meet the same problem. it was caused by the caffe version that is suitable for faster-rcnn. I replace the "smooth_L1_loss_layer.cpp" and "smooth_L1_loss_layer.cu" with the same name file that is in fast-rcnn caffe

I do what you said but an error occurs.

src/caffe/layers/smooth_L1_loss_layer.cpp:8:38: fatal error: caffe/fast_rcnn_layers.hpp: No such file or directory
compilation terminated.
Makefile:572: recipe for target '.build_release/src/caffe/layers/smooth_L1_loss_layer.o' failed
make: *** [.build_release/src/caffe/layers/smooth_L1_loss_layer.o] Error 1
make: *** Waiting for unfinished jobs....

Are you sure just replacing can work?

我直接用中文吧,我用的是这个版本的caffe(https://github.com/nils489/caffe-fast-rcnn) faster-rcnn branch. 支持cuda 5.按照我之前说的,训练是没问题,你可以试一下

谢谢,我用了这个版本,并按你说的成功开始了训练,但在snapshot()时net.save_hdf5()函数报错: AttributeError: 'Net' object has no attribute 'save_hdf5' 我试着使用net.save()函数来保存,但这样在训练结束后,测试读取网络时又会报错,语句是: net = caffe.Net(prototxt, caffemodel, caffe.TEST) 错误信息时:

HDF5-DIAG: Error detected in HDF5 (1.8.16) thread 139682196551424:
  #000: ../../../src/H5F.c line 604 in H5Fopen(): unable to open file
    major: File accessibilty
    minor: Unable to open file
  #001: ../../../src/H5Fint.c line 1087 in H5F_open(): unable to read superblock
    major: File accessibilty
    minor: Read failed
  #002: ../../../src/H5Fsuper.c line 277 in H5F_super_read(): file signature not found
    major: File accessibilty
    minor: Not an HDF5 file
F0313 05:40:20.055796    65 net.cpp:864] Check failed: file_hid >= 0 (-1 vs. 0) Couldn't open ./output/rgbd_3det_iter_40000.h5
*** Check failure stack trace: ***

请问这应该怎么解决?

已解决。 发现忘记改保存的文件名后缀,吧.h5改成.caffemodel就可以了

Bachery avatar Mar 13 '19 05:03 Bachery