编译过程挺顺利的,完全参照之前编译的caffe的makefile进行就好。运行./experiments/scripts/faster_rcnn_alt_opt.sh 0 VGG16 pascal_voc,遇到的问题做个小汇总:
1. python layer
F1107 02:52:02.470175 4181 layer_factory.hpp:81] Check failed: registry.count(type) == 1 (0 vs. 1) Unknown layer type: Python (known types: AbsVal, Accuracy, ArgMax, BNLL, BatchNorm, BatchReindex, Bias, Concat, ContrastiveLoss, Convolution, Data, Deconvolution, Dropout, DummyData, ELU, Eltwise, Embed, EuclideanLoss, Exp, Filter, Flatten, HDF5Data, HDF5Output, HingeLoss, Im2col, ImageData, InfogainLoss, InnerProduct, LRN, Log, MVN, MemoryData, MultinomialLogisticLoss, PReLU, Pooling, Power, ROIPooling, ReLU, Reduction, Reshape, SPP, Scale, Sigmoid, SigmoidCrossEntropyLoss, Silence, Slice, SmoothL1Loss, Softmax, SoftmaxWithLoss, Split, TanH, Threshold, Tile, WindowData)
把$py-faster-rcnn/caffe-fast-rcnn里面的Makefile.config文件中的下面一行的注释取消:
# Uncomment to support layers written in Python (will link against Python libs)
WITH_PYTHON_LAYER := 1 #把这一行的注释取消
然后再make clean后重新make -j & make pycaffe即可
2.
AttributeError: 'module' object has no attribute 'text_format'
然后使用sudo pip install protobuf==2.5.0,error变成了以下:
cannot import name symbol_database
然后sudo pip install –upgrade protobuf,error重新变回:
AttributeError: 'module' object has no attribute 'text_format'
所以最终解决办法应该是在./lib/fast_rcnn/train.py中加上import google.protobuf.text_format即可
目前就遇到以上两个问题,解决后已经可以成功跑起来了。