搭建及訓練py-R-FCN遇到的問題
搭建py-R-FCN遇到的問題記錄。
make pycaffe 報錯
[html] view plain copy
src/caffe/layers/box_annotator_ohem_layer.cu(49): error: a template argument may not reference a local type
detected during instantiation of "void caffe::BoxAnnotatorOHEMLayer<Dtype>::Forward_gpu(const std::vector<caffe::Blob<Dtype> *, std::allocator<caffe::Blob<Dtype> *>> &, const std::vector<caffe::Blob<Dtype> *, std::allocator<caffe::Blob<Dtype> *>> &) [with Dtype=float]"
(80): here
src/caffe/layers/box_annotator_ohem_layer.cu(49): error: a template argument may not reference a local type
detected during instantiation of "void caffe::BoxAnnotatorOHEMLayer<Dtype>::Forward_gpu(const std::vector<caffe::Blob<Dtype> *, std::allocator<caffe::Blob<Dtype> *>> &, const std::vector<caffe::Blob<Dtype> *, std::allocator<caffe::Blob<Dtype> *>> &) [with Dtype=double]"
(80): here
2 errors detected in the compilation of "/tmp/tmpxft_0000339c_00000000-19_box_annotator_ohem_layer.compute_61.cpp1.ii".
Makefile:595: recipe for target '.build_release/cuda/src/caffe/layers/box_annotator_ohem_layer.o' failed
make: *** [.build_release/cuda/src/caffe/layers/box_annotator_ohem_layer.o] Error 1
解決方法:
box_annotator_ohem_layer uses C++11 features, you need to make changes to the makefile
修改makefile
319行部分改成:
ifeq ($(DEBUG), 1)
COMMON_FLAGS += -DDEBUG -g -O0 -std=c++11
NVCCFLAGS += -G
else
COMMON_FLAGS += -DNDEBUG -O2 -std=c++11
endif
訓練的時候遇到的問題:AttributeError: 'module' object has no attribute 'text_format'
之前遇到過,沒記錄,現在記錄下來。解決方法:
在出錯的檔案里加上:import google.protobuf.text_format
我這裡錯誤提示在train.py裡,所以找到train.py加上import google.protobuf.text_format
---------------------
作者:Bankeey
來源:CSDN
原文:https://blog.csdn.net/Bankeey/article/details/77573860
版權宣告:本文為博主原創文章,轉載請附上博文連結!