您的位置:首页 > Web前端

Caffe安装问题汇总

2016-03-05 09:39 483 查看

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_PATH
ldconfig /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.sh
I0127 22:19:24.988464 29691 caffe.cpp:99] Use GPU with device ID 0
F0127 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-file
apt-file update
apt-file search bzlib.h
sudo apt-get install libboost-python1.55.0
sudo apt-get install libboost-all-dev
Or you can call

aptitude search boost


5.常用make

make clean
rm -rf build
make all -j8
make pycaffe
make distribute
make test -j8
make 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.6
boost::python::register_ptr_to_python<boost::shared_ptr<Blob<Dtype> > >();
// End fix

bp::class_<Blob<Dtype>, boost::shared_ptr<Blob<Dtype> >, boost::noncopyable>(
"Blob", bp::no_init)
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: