首先在软件更新处更换显卡驱动 具体就不介绍了
Cuda:
1.sudo apt-get install build-essential
2.sudo apt-get install libprotobuf-dev libleveldb-dev libsnappy-dev libopencv-dev libboost-all-dev libhdf5-serial-dev libgflags-dev libgoogle-glog-dev liblmdb-dev protobuf-compiler
3.sudo dpkg -i cuda-repo-<distro>_<version>_<architecture>.deb # 自己的.deb包名
4.sudo apt-get update
5.sudo apt-get install cuda
reboot
Cudnn:
# 解压cudnn包
1.cd cuda
2.sudo cp lib64/lib* /usr/local/cuda/lib64/
3.sudo cp include/cudnn.h /usr/local/cuda/include/
4.sudo gedit /etc/profile
#写入
PATH=/usr/local/cuda/bin:$PATH
export PATH
5.source /etc/profile
6. cd /etc/ld.so.conf.d/ sudo gedit cuda.conf
7. write:/usr/local/cuda/lib64
8. sudo ldconfig
#如果出现 /sbin/ldconfig.real: /usr/local/cuda-8.0/targets/x86_64-linux/lib/libcudnn.so.7 is not a symbolic link :
#执行
sudo ln -sf /usr/local/cuda-8.0/targets/x86_64-linux/lib/libcudnn.so.7.0.5 /usr/local/cuda-8.0/targets/x86_64-linux/lib/libcudnn.so.7
9. cd usr/local/cuda/samples
10. sudo make all -j811. cd samples/bin/x86_64/linux/releade
12. 执行 ./deviceQuery 如果出现 result = pass: ok
cuda 安装成功
caffe2 :
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
build-essential \
cmake \
git \
libgoogle-glog-dev \
libgtest-dev \
libiomp-dev \
libleveldb-dev \
liblmdb-dev \
libopencv-dev \
libopenmpi-dev \
libsnappy-dev \
libprotobuf-dev \
openmpi-bin \
openmpi-doc \
protobuf-compiler \
python-dev \
python-pip
#出现
pip error :
sudo python -m pip install --upgrade --force pip
sudo pip install setuptools==33.1.1
sudo pip install \
future \
numpy \
protobuf
sudo apt-get install -y --no-install-recommends libgflags-dev
git clone --recursive https://github.com/pytorch/pytorch.git && cd pytorch
mkdir build && cd build
sudo cmake ..
sudo make -j8 install
mkdir build && cd build
# 运行 cd ~ && python -c 'from caffe2.python import core' 2>/dev/null && echo "Success" || echo "Failure"
#如果 Failure:
#运行 sudo gedit ~/.bashrc
export PYTHONPATH=/usr/local:$PYTHONPATH
export PYTHONPATH=$PYTHONPATH:/home/**/devapp/caffe2/build (**为计算机名)
export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
验证二:
python2 -c 'from caffe2.python import workspace; print(workspace.NumCudaDevices())'
coco:
# COCOAPI=/path/to/clone/cocoapi
git clone https://github.com/cocodataset/cocoapi.git $COCOAPI
cd $COCOAPI/PythonAPI
# Install into global site-packages
sudo make install
如果出现: x86_64-linux-gnu-gcc: error: pycocotools/_mask.c: 没有那个文件或目录
x86_64-linux-gnu-gcc: fatal error: no input files :
sudo pip install Cython
sudo pip install matplotlib
# Alternatively, if you do not have permissions or prefer
# not to install the COCO API into global site-packages
sudo python2 setup.py install --user
detectron:
git clone https://github.com/facebookresearch/detectron $DETECTRON
Install Python dependencies:
sudo pip install -r $DETECTRON/requirements.txt
Set up Python modules:
cd $DETECTRON && make
Check that Detectron tests pass (e.g. for SpatialNarrowAsOp test):
python2 $DETECTRON/detectron/tests/test_spatial_narrow_as_op.py