64位Ubuntu+GTX960+CUDA8.0+OpenCV3.2+Caffe

本文档详细介绍了如何在Linux环境下安装Caffe深度学习框架及其依赖库,并提供了使用mnist数据集进行测试的具体步骤。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1.安装依赖项

sudo apt-get install -y build-essential
sudo apt-get install -y libprotobuf-dev libleveldb-dev libsnappy-dev libopencv-dev libboost-all-dev libhdf5-serial-dev libgflags-dev libgoogle-glog-dev liblmdb-dev protobuf-compiler
sudo apt-get install -y freeglut3-dev libx11-dev libxmu-dev libxi-dev  libglu1-mesa libglu1-mesa-dev

2.安装CUDA

3.安装atlas

sudo apt-get install -y libatlas-base-dev

4.安装OpenCV

5.Python

sudo apt-get install -y python-pip
sudo apt-get install -y cython python-numpy python-scipy python-skimage python-protobuf
sudo apt-get install -y python-matplotlib python-h5py python-leveldb python-networkx 
sudo apt-get install -y  python-pandas python-sympy python-nose python-dateutil python-gflags
pip install ipython==5.0.0
  • 如果有问题可以执行
pip install --upgrade pip
sudo pip install argparse

6.安装Caffe

git clone git@github.com:BVLC/caffe.git
cd caffe
sudo pip install -r python/requirements.txt
cp Makefile.config.example Makefile.config
gedit Makefile.config 将其中的"-gencode arch=compute_20, code=sm_20"和  
"-gencode arch=compute_20, code=sm_21"这两行删掉,并依照需要设置USE_CUDNN,PYTHON_INCLUDE等
make all -j8 
make test -j8
make runtest -j8
make pycaffe -j8
gedit ~/.bashrc 添加 export PYTHONPATH=< path-to-caffe >/caffe/python
source ~/.bashrc 即可在Python中使用Caffe模块

7.mnist数据测试

cd caffe
sh data/mnist/get_mnist.sh
sh examples/mnist/create_mnist.sh
vim examples/mnist/lenet_solver.prototxt
./examples/mnist/train_lenet.sh

8.问题及办法(使用Anaconda导致的)

  • (1) undefined reference to `TIFFReadRGBAStrip@LIBTIFF_4.0’
sudo apt-get install libtiff4-dev
也可能是权限问题,使用sudo make
  • (2) libcudart.so.8.0: cannot open shared object file: No such file or directory
sudo ldconfig /usr/local/cuda/lib64
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

刀么克瑟拉莫

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值