Ubuntu14.04 caffe编译
生活不止眼前的苟且 ~~
编译步骤
一、git clone https://github.com/BVLC/caffe.git
目录如下:
二、cp Makefile.config.example Makefile.config
修改1: 启用CUDNN,去掉”#”
USE_CUDNN := 1
修改2: opencv版本为3.1.0
Makefile文件需添加opencv_imgcodecs
LIBRARIES += glog gflags protobuf leveldb snappy \
lmdb boost_system hdf5_hl hdf5 m \
opencv_core opencv_highgui opencv_imgproc opencv_imgcodecs
-
三、编译
- make all -j4
- make test
- make runtest
- make pycaffe 四、训练mnist
-
1、 数据预处理
data/mnist/get_mnist.sh -
2、 重建lmdb文件。
examples/mnist/create_mnist.sh
生成mnist-train-lmdb 和 mnist-train-lmdb文件夹,这里包含了lmdb格式的数据集 -
3、训练mnist
examples/mnist/train_lenet.sh