- 安装Cuda9.0+cuDNN7.4
0.1 查看cuda: nvcc --version
0.2 查看cudnn:cat /usr/local/cuda/include/cudnn.h | grep CUDNN_MAJOR -A 2 - anaconda创建虚拟环境:conda create -n detectron python=3.6.7,进入环境,conda activate detectron
- 下载相应的pytorch可以去清华镜像站下载:https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/linux-64/
安装下载好的pytorch-nightly,注意安装路径不能有中文
conda install pytorch-nightly-1.0.0.dev20190409-py3.6_cuda9.0.176_cudnn7.4.2_0.tar.bz2
pytorch1.0 里面包含了caffe2 所以安装好pytorch-nightly后,直接测试caffe2。 - conda install protobuf
conda install future - pytorch1.0 里面包含了caffe2 所以安装好pytorch-nightly后,直接测试caffe2
包含两句测试代码
测试代码1:
python -c ‘from caffe2.python import core’ 2>/dev/null && echo “Success” || echo “Failure”
测试代码2:
python -c ‘from caffe2.python import workspace; print(workspace.NumCudaDevices())’
第一个failure 第二个提示妹装numpy
conda install numpy 以后 第一个success 第二个1 表示成功
5.安装COCOAPI
# COCOAPI=/path/to/clone/cocoapi
git clone https://github.com/cocodataset/cocoapi.git $COCOAPI
cd $COCOAPI/PythonAPI
# Install into global site-packages
make install
python setup.py install --user
- git clone https://github.com/facebookresearch/detectron $DETECTRON
pip install -r detectron/requirements.txt
cd detectron/
make
python /detectron/tests/test_spatial_narrow_as_op.py
https://blog.csdn.net/weixin_39916966/article/details/99728387
https://blog.csdn.net/qq_34782826/article/details/99883057
https://blog.csdn.net/qq_40306953/article/details/84207960 //训练自己的数据集
pip国内的一些镜像
阿里云 http://mirrors.aliyun.com/pypi/simple/
中国科技大学 https://pypi.mirrors.ustc.edu.cn/simple/
豆瓣(douban) http://pypi.douban.com/simple/
清华大学 https://pypi.tuna.tsinghua.edu.cn/simple/
中国科学技术大学 http://pypi.mirrors.ustc.edu.cn/simple/
修改源方法:
临时使用:
可以在使用pip的时候在后面加上-i参数,指定pip源
eg: pip install scrapy -i https://pypi.tuna.tsinghua.edu.cn/simple
参考:https://blog.csdn.net/johinieli/article/details/80056283