Q1:安装setproctitle:
sudo easy_install setproctitle
Q2:
Check failed: registry.count(type) == 1 (0 vs. 1) Unknown layer type
I1221 19:43:06.790405 12895 layer_factory.hpp:76] Creating layer proposal
F1221 19:43:06.790431 12895 layer_factory.hpp:80] Check failed: registry.count(type) == 1 (0 vs. 1) Unknown layer type: Python (known types: AbsVal, Accuracy, ArgMax, BNLL, Concat, ContrastiveLoss, Convolution, Data, Deconvolution, Dropout, DummyData, 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, Sigmoid, SigmoidCrossEntropyLoss, Silence, Slice, SmoothL1Loss, Softmax, SoftmaxWithLoss, Split, TanH, Threshold, Tile, WindowData)
* Check failure stack trace: *
Aborted (core dumped)
A2: caffe的Makefile.config配置有误
Note: Caffe must be built with support for Python layers!
# In your Makefile.config, make sure to have this line uncommented
WITH_PYTHON_LAYER := 1
修改完成后
cd ~/caffe
make clean
make -j
make pycaffe
Q3:
I0707 15:31:00.039484 21488 layer_factory.hpp:77] Creating layer data
ImportError: No module named layers
Traceback (most recent call last):
File “examples/fcn/voc-fcn8s/solve.py”, line 17, in
solver = caffe.SGDSolver(‘examples/fcn/voc-fcn8s/solver.prototxt’)
SystemError: NULL result without error in PyObject_Call
A3: 错误原因在于创建train.protxt中的python层时,找不到layers module, 也就是没有找到layers.py那个文件.
layer {
name: “data”
type: “Python”
top: “data”
top: “label”
python_param {
module: “layers”
layer: “SBDDSegDataLayer”
param_str: “{\’sbdd_dir\’: \’../../data/sbdd/dataset\’, \’seed\’: 1337, \’split\’: \’train\’, \’mean\’: (104.00699, 116.66877, 122.67892)}”
}
}
在一个博客(http://blog.csdn.net/thesby/article/details/51264439)中看到
layer {
type: ‘Python’
name: ‘loss’
top: ‘loss’
bottom: ‘ipx’
bottom: ‘ipy’
python_param {
# the module name – usually the filename – that needs to be in $PYTHONPATH
module: ‘pyloss’
# the layer name – the class name in the module
layer: ‘EuclideanLossLayer’
}
# set loss weight so Caffe knows this is a loss layer
loss_weight: 1
}
于是,我在下载下来的fcn包里有一个文件名为voc_layers.py的文件,里面有个class 与上面python层的layer名相同.将voc_layers.py复制到voc-fcn8s文件夹里,把module名改为”voc_layers”,重新运行solve.py,就没有出现上面的问题.