2017-05-05 87 views
0

我使用的Ubuntu 14.04没有GPU,我想运行此代码(仅CPU):https://github.com/xinleipan/py-faster-rcnn-with-new-dataset。 我我做的:python ./tools/demo.py --cpu --net vgg16他打印此错误:caffe.Net AttributeError:无法设置属性

I0505 14:45:53.473182 7095 net.cpp:122] Setting up rpn_cls_prob_reshape 
I0505 14:45:53.473208 7095 net.cpp:129] Top shape: 1 18 14 14 (3528) 
I0505 14:45:53.473222 7095 net.cpp:137] Memory required for data: 117496524 
I0505 14:45:53.473233 7095 layer_factory.hpp:77] Creating layer proposal 
I0505 14:45:53.515135 7095 net.cpp:84] Creating Layer proposal 
I0505 14:45:53.515180 7095 net.cpp:406] proposal <- rpn_cls_prob_reshape 
I0505 14:45:53.515198 7095 net.cpp:406] proposal <- rpn_bbox_pred 
I0505 14:45:53.515211 7095 net.cpp:406] proposal <- im_info 
I0505 14:45:53.515228 7095 net.cpp:380] proposal -> rois 
Traceback (most recent call last): 
    File "./tools/demo.py", line 134, in <module> 
    net = caffe.Net(prototxt, caffemodel, caffe.TEST) 
AttributeError: can't set attribute 

如何解决这个

+0

此帖未显示任何研究工作。如果你看看python文件,你会发现你必须使用'--cpu'。 – lnman

+0

另一个问题: 'File“./tools/demo.py”,第134行,在 net = caffe.Net(prototxt,caffemodel,caffe.TEST)' –

+0

您需要发布整个错误消息。没有人能够自动推断它。 – lnman

回答

0

PR说,这个问题是与朱古力版本不匹配。只需评论以下行

self_.attr("phase") = static_cast(this->phase_); 

in include/layers/python_layer.hpp in caffe。

+0

@inman同样的问题仍然存在 –

+0

你在评论后没有重建caffe,对吧? – lnman