solve.py 调试

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,就没有出现上面的问题.

  • 2
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 9
    评论
评论 9
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值