caffe-键安装及相关问题

  • caffe一键安装
    新建脚本:touch caffe_install.sh
    运行脚本:sudo sh caffe_install.sh
CAFFE_ROOT=~/share/caffe
sudo apt-get install libprotobuf-dev libleveldb-dev libsnappy-dev libopencv-dev libhdf5-serial-dev protobuf-compiler
sudo apt-get install --no-install-recommends libboost-all-dev
sudo apt-get install libatlas-base-dev
sudo apt-get install libopenblas-dev
sudo apt-get install libgflags-dev libgoogle-glog-dev liblmdb-dev

cd $CAFFE_ROOT/python
sudo apt-get install python-pip python3-pip
pip install --upgrade -i https://pypi.tuna.tsinghua.edu.cn/simple pip
pip3 install --upgrade -i https://pypi.tuna.tsinghua.edu.cn/simple pip
for req in $(cat requirements.txt); do pip install -i https://pypi.tuna.tsinghua.edu.cn/simple $req; done
for req in $(cat requirements.txt); do pip3 install -i https://pypi.tuna.tsinghua.edu.cn/simple $req; done

sudo rm -rf $CAFFE_ROOT/build
mkdir -p $CAFFE_ROOT/build
cd $CAFFE_ROOT/build
cmake ..
make -j16
make pycaffe
sudo make install
  • python3中import caffe :RuntimeWarning: numpy.dtype size changed, may indicate binary incompatibility问题

    原因:numpy版本不合适
    解决方法:
    sudo pip3 uninstall numpy
    sudo pip3 install -i https://pypi.tuna.tsinghua.edu.cn/simple numpy==1.14.5

猜你喜欢

转载自blog.csdn.net/u013187057/article/details/81479099
今日推荐