创建python环境
输入命令:
conda create -n paddle python=3.6
激活环境:
activate paddle
安装gpu框架
1、首先看自己的CUDA、Cudnn的版本是多少,我的CUDA版本是9.0,Cudnn是7.4
如果是CUDA=10.0 则下方语句中改成 .post107
2、如果不使用镜像的话下载速度会比较慢,加上镜像加快速度
3、现在大多数paddledetection的api都在1.6以上,所以这里下载gpu1.8版本的, .post97分别对应的CUDA、Cudnn的版本号码
输入命令:
python -m pip install paddlepaddle-gpu==1.8.1.post97 -i https://mirror.baidu.com/pypi/simple
测试环境:
进入python环境分别输入以下语句:
import paddle.fluid as fluid
fluid.install_check.run_check()
输出:
安装gpu框架完成
安装coco-api:
输入命令:
pip install Cython
# 我下载时遇到了这个问题,需要更新pip,更新后重新下载
python -m pip install --upgrade pip
下载api:(此处我出现了问题,所以使用github)
pip install git+https://github.com/philferriere/cocoapi.git
如果下载速度太慢或者下载失败,直接进入github下载支持windows版本的cocoapi:https://github.com/philferriere/cocoapi
cd到解压后的文件夹中的PythonAPI文件夹,对api进行编译:
python setup.py install
此处可能有非常多的报错,谨慎处理!!!
最终完成后:
下载PaddleDetection
输入命令:(路径下)
git clone https://github.com/PaddlePaddle/PaddleDetection.git
也可以直接在github上下载:https://github.com/PaddlePaddle/PaddleDetection
安装Python依赖库:
pip install -r requirements.txt
测试是否安装成功:
python ppdet/modeling/tests/test_architectures.py
显示OK即可
本文按照官方文档过程实现,链接:https://github.com/PaddlePaddle/PaddleDetection/blob/release/0.3/docs/tutorials/INSTALL_cn.md