编译过程:
make all -j8
make pycaffe -j8
进入Python
import caffe
训练和测试
caffe目录下运行:./examples/mnist/train_lenet.sh
遇到的问题:
- 编译后进入Python,输入
import caffe
出现错误:ImportError: No module named caffe
原因:没有将caffe/python引入Python目录中
解决:vim ~/.bashrc
再文件最后一行写入export PYTHONPATH=~/caffe/python:$PYTHONPATH
之后又出现错误:
from ._caffe import Net, SGDSolver, NesterovSolver, AdaGradSolver, \ ImportError: No module named _caffe
原因:caffe的Python模块没编译
解决:make pycaffe -j8
- 重复编译
make: Nothing to be done for 'pycaffe'.
或make: Nothing to be done for 'all'
之类的,即为重复编译,
解决:make clean
再进行编译