相关依赖
caffe2的依赖比caffe要干净很多,必要的库比较少
- cmake
- git
- glog
- protobuf
- CUDA (optional)
- cudnn (optional)
caffe2安装
git clone --recursive https://github.com/caffe2/caffe2.git
cd caffe2
make -j8
cd build
sudo make install
# test
python -c 'from caffe2.python import core' 2>/dev/null && echo "Success" || echo "Failure"
python -m caffe2.python.operator_test.relu_op_test
# Environment Variables
export PYTHONPATH=$PYTHONPATH:/home/15072585/caffe2/build #(add to ~/.bashrc)
tips
- gpu版本报错,已经在github issue上提问了https://github.com/caffe2/caffe2/issues/1297,解决方案安装gcc 4.9.4
tar jxf gcc-4.9.4.tar.bz2
cd gcc-4.9.4
./configure --enable-checking=release --enable-languages=c,c++ --disable-multilib --prefix=/home/yang/gcc
make -j8
make install
export PATH=/home/yang/gcc/bin:$PATH
export LD_LIBRARY_PATH=/home/yang/gcc/lib64:$LD_LIBRARY_PATH
from caffe2.python import core
报错No module named past.builtins
,解决方案pip install future