首页  编辑  

Py-faster-rcnn 训练错误

Tags: /Python/   Date Created:
py-faster-rcnn,训练时报错:
$python ./tools/train_net.py --gpu 0
...
Traceback (most recent call last):
  File "./tools/train_net.py", line 113, in <module>
    max_iters=args.max_iters)
  File "/home/source/py-faster-rcnn/tools/../lib/fast_rcnn/train.py", line 158, in train_net
    pretrained_model=pretrained_model)
  File "/home/source/py-faster-rcnn/tools/../lib/fast_rcnn/train.py", line 44, in __init__
    self.solver = caffe.SGDSolver(solver_prototxt)
Boost.Python.ArgumentError: Python argument types in
    SGDSolver.__init__(SGDSolver, NoneType)
did not match C++ signature:
    __init__(_object*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)
原因:
--solver 参数为空,结果Python的None对象无法转换成C++的string导致的。

解决方法,带--solver参数运行即可:
 python tools/train_net.py --solver ./models/pascal_voc/VGG16/fast_rcnn/solver.prototxt