Caffe安装问题汇总

来源:互联网 发布:seo效果明显吗 编辑:程序博客网 时间:2024/06/05 03:26

1.cannot open shared object file no such file or directory runtest error 127 caffe

export LD_LIBRARY_PATH=/usr/local/cuda-6.5/lib64:$LD_LIBRARY_PATHldconfig /usr/local/cuda-6.5/lib64/$ make clean$ make all -j8

2.Training LeNet on MNIST with Caffe

~/work/caffe@cherry-com(20205)$ ./examples/mnist/train_lenet.shI0127 22:19:24.988464 29691 caffe.cpp:99] Use GPU with device ID 0F0127 22:19:24.988605 29691 common.cpp:53] CPU-only Mode: cannot make GPU call.*** Check failure stack trace: ***    @     0x7fd445fa6dbd  google::LogMessage::Fail()    @     0x7fd445fa8c5d  google::LogMessage::SendToLog()    @     0x7fd445fa69ac  google::LogMessage::Flush()    @     0x7fd445fa957e  google::LogMessageFatal::~LogMessageFatal()    @           0x44c040  caffe::Caffe::SetDevice()    @           0x411bb5  train()    @           0x40eff1  main    @     0x7fd44301eec5  (unknown)    @           0x410767  (unknown)Aborted (core dumped)

$ vi examples/mnist/lenet_solver.prototxt<<<<<<<<<<<<<<<<<<<< before 24 # solver mode: CPU or GPU 25 solver_mode: GPU------------------------------------------- 24 # solver mode: CPU or GPU 25 solver_mode: CPU>>>>>>>>>>>>>>>>>>>>> after

3.make pycaffe

首先导入Python的路径
export PYTHONPATH=$PYTHONPATH:/home/vr/Documents/Caffe/setup/caffe-master/python/caffe

在$caffe-root中
make pycaffe


4.boost安装

sudo apt-get install libboost-all-dev
sudo apt-get install apt-fileapt-file updateapt-file search bzlib.h
sudo apt-get install libboost-python1.55.0
sudo apt-get install libboost-all-devOr you can callaptitude search boost


5.常用make

make cleanrm -rf buildmake all -j8make pycaffemake distributemake test -j8make runtest -j8


6.No to_python (by-value) converter found for C++ type: boost::shared_ptr<caffe::Blob<float> >

I managed to get it working with boost 1.6 by editing the python/caffe/_caffe.cpp file and registering the Blobs shared pointer. I.e in line 257 or so add:
// Fix for caffe pythonwrapper for boost 1.6boost::python::register_ptr_to_python<boost::shared_ptr<Blob<Dtype> > >();// End fixbp::class_<Blob<Dtype>, boost::shared_ptr<Blob<Dtype> >, boost::noncopyable>(  "Blob", bp::no_init)




0 0
原创粉丝点击