Windows11装paddledetection全踩坑记录

由于windows11已经给我装好cuda11.6了,我就直接不管cuda版本装paddledetection

官网教程:

https://github.com/PaddlePaddle/PaddleDetection/blob/develop/docs/tutorials/INSTALL_cn.md

上不去github?

手把手教你配置:

1.安装PaddlePaddle

默认你cuda与cudnn配置好了后,基本没什么坑

# CUDA10.1
python -m pip install paddlepaddle-gpu==2.2.0.post101 -f https://www.paddlepaddle.org.cn/whl/linux/mkl/avx/stable.html

官网还要其他cuda版本安装教程,自己尝试吧;

2. 安装PaddleDetection(太多坑了)

2.1从仓库clone:这里clone的是develop版本,即实时最新版

# 克隆PaddleDetection仓库

git clone https://github.com/PaddlePaddle/PaddleDetection.git -b develop

如果网络连接不上尝试加https代理或者更改host文件:

Host文件一般在“C(系统盘):\Windows\System32\drivers\etc”文件夹下

将对应的Host地址修改为:(把原来有github的网站注释掉:加#,然后增添如下代码到host文件,保存)

#github
140.82.112.4 github.com
199.232.69.194 github.global.ssl.fastly.net

如果没有host修改权限,可以用管理员身份运行文档:然后打开C(系统盘):\Windows\System32\drivers\etc路径的hostw文件修改即可

Windows11装paddledetection全踩坑记录_第1张图片

 2.2安装相关依赖(坑最多)

先cd 到刚才clone的paddledetection文件夹里,然后执行如下命令(这里调整装依赖的顺序,保证一遍成功,与官方顺序不同,当然如果你按官方的顺序执行报错,可以按这个顺序装):

2.2.1先装cython:(采用换源pip换源安装:使用的清华源)

pip install cython -i https://pypi.tuna.tsinghua.edu.cn/simple 

2.2.2为了解决如下报错, 装cython-bbox

cl: 命令行 error D8021 :无效的数值参数“/Wno-cpp”
error: command ‘D:\programs\vision studio 2015\VC\BIN\x86_amd64\cl.exe’ failed with exit status 2
ERROR: Failed building wheel for cython-bbox

 因为windows无法通过pip install cython-bbox直接装,会出现上面错误,所以采用clone再steup的方法装:

#1.先clone cython-bbox包:
git clone https://github.com/samson-wang/cython_bbox.git

#2.找到刚才clone的cython-bbox包里的steup.py 文件,:
    修改:extra_compile_args=[’-Wno-cpp’]
    替换:extra_compile_args = {'gcc': ['/Qstd=c99']}
     似乎源文件已经修改直接进行第3步

#3.cd 到刚才clone的cython-bbox包目录下,运行如下命令:
python setup.py build_ext install

2.2.3 原版cocoapi不支持Windows,pycocotools依赖可能安装失败,可采用第三方实现版本,该版本仅支持Python3

pip install git+https://github.com/philferriere/cocoapi.git#subdirectory=PythonAPI

 如果出现如下报错:

Windows11装paddledetection全踩坑记录_第2张图片

 则:

#设置ssl
git config --global http.sslVerify "false" 

#再pip一下
pip install git+https://github.com/philferriere/cocoapi.git#subdirectory=PythonAPI

如果出现下面错误: 说明网络不好,建议换手机热点,或者换代理

Windows11装paddledetection全踩坑记录_第3张图片

 代理设置与取消:

#设置全局代理
git config --global https.proxy

#取消代理
git config --global --unset https.proxy

 我们直接在终端先输入设置代理的命令,再输入取消代理的命令即可解决

Windows11装paddledetection全踩坑记录_第4张图片

2.2.4然后可以按照官方的流程执行了 

这里我安装requirements时更换中科大源了,速度会快些

# 安装其他依赖
cd PaddleDetection
pip install -r requirements.txt  -i https://pypi.mirrors.ustc.edu.cn/simple/   

# 编译安装paddledet
python setup.py install

安装成功:

Windows11装paddledetection全踩坑记录_第5张图片

编译成功:

 Windows11装paddledetection全踩坑记录_第6张图片

 开始本地炼丹!!!!

附录解决过程中帮助比较大的几篇文章:

https://blog.csdn.net/qq_19707521/article/details/106692395?ops_request_misc=%257B%2522request%255Fid%2522%253A%2522164826040716780366597085%2522%252C%2522scm%2522%253A%252220140713.130102334..%2522%257D&request_id=164826040716780366597085&biz_id=0&utm_medium=distribute.pc_search_result.none-task-blog-2~all~sobaiduend~default-2-106692395.142^v5^pc_search_result_control_group,143^v6^control&utm_term=+cython_bbox+&spm=1018.2226.3001.4187icon-default.png?t=M276https://blog.csdn.net/qq_19707521/article/details/106692395?ops_request_misc=%257B%2522request%255Fid%2522%253A%2522164826040716780366597085%2522%252C%2522scm%2522%253A%252220140713.130102334..%2522%257D&request_id=164826040716780366597085&biz_id=0&utm_medium=distribute.pc_search_result.none-task-blog-2~all~sobaiduend~default-2-106692395.142^v5^pc_search_result_control_group,143^v6^control&utm_term=+cython_bbox+&spm=1018.2226.3001.4187https://blog.csdn.net/weixin_52796927/article/details/121664227?ops_request_misc=%257B%2522request%255Fid%2522%253A%2522164825911116780261966684%2522%252C%2522scm%2522%253A%252220140713.130102334..%2522%257D&request_id=164825911116780261966684&biz_id=0&utm_medium=distribute.pc_search_result.none-task-blog-2~all~sobaiduend~default-1-121664227.142^v5^pc_search_result_control_group,143^v6^control&utm_term=+Failed+to+connect+to+github.com+port+443+after+21083+ms%3A+Timed+out++++++&spm=1018.2226.3001.4187icon-default.png?t=M276https://blog.csdn.net/weixin_52796927/article/details/121664227?ops_request_misc=%257B%2522request%255Fid%2522%253A%2522164825911116780261966684%2522%252C%2522scm%2522%253A%252220140713.130102334..%2522%257D&request_id=164825911116780261966684&biz_id=0&utm_medium=distribute.pc_search_result.none-task-blog-2~all~sobaiduend~default-1-121664227.142^v5^pc_search_result_control_group,143^v6^control&utm_term=+Failed+to+connect+to+github.com+port+443+after+21083+ms%3A+Timed+out++++++&spm=1018.2226.3001.4187https://blog.csdn.net/weixin_40912987/article/details/106427313?spm=1001.2101.3001.6661.1&utm_medium=distribute.pc_relevant_t0.none-task-blog-2%7Edefault%7ECTRLIST%7ERate-1.pc_relevant_default&depth_1-utm_source=distribute.pc_relevant_t0.none-task-blog-2%7Edefault%7ECTRLIST%7ERate-1.pc_relevant_default&utm_relevant_index=1icon-default.png?t=M276https://blog.csdn.net/weixin_40912987/article/details/106427313?spm=1001.2101.3001.6661.1&utm_medium=distribute.pc_relevant_t0.none-task-blog-2%7Edefault%7ECTRLIST%7ERate-1.pc_relevant_default&depth_1-utm_source=distribute.pc_relevant_t0.none-task-blog-2%7Edefault%7ECTRLIST%7ERate-1.pc_relevant_default&utm_relevant_index=1https://blog.csdn.net/chenghuikai/article/details/55258957?ops_request_misc=%257B%2522request%255Fid%2522%253A%2522164826002316780255273191%2522%252C%2522scm%2522%253A%252220140713.130102334..%2522%257D&request_id=164826002316780255273191&biz_id=0&utm_medium=distribute.pc_search_result.none-task-blog-2~all~top_positive~default-2-55258957.142^v5^pc_search_result_control_group,143^v6^control&utm_term=pip%E6%8D%A2%E6%BA%90&spm=1018.2226.3001.4187icon-default.png?t=M276https://blog.csdn.net/chenghuikai/article/details/55258957?ops_request_misc=%257B%2522request%255Fid%2522%253A%2522164826002316780255273191%2522%252C%2522scm%2522%253A%252220140713.130102334..%2522%257D&request_id=164826002316780255273191&biz_id=0&utm_medium=distribute.pc_search_result.none-task-blog-2~all~top_positive~default-2-55258957.142^v5^pc_search_result_control_group,143^v6^control&utm_term=pip%E6%8D%A2%E6%BA%90&spm=1018.2226.3001.4187https://blog.csdn.net/weixin_43945983/article/details/110882074?ops_request_misc=%257B%2522request%255Fid%2522%253A%2522164826372916782089376120%2522%252C%2522scm%2522%253A%252220140713.130102334..%2522%257D&request_id=164826372916782089376120&biz_id=0&utm_medium=distribute.pc_search_result.none-task-blog-2~all~sobaiduend~default-1-110882074.142^v5^pc_search_result_control_group,143^v6^control&utm_term=+OpenSSL+SSL_read%3A+Connection+was+reset%2C+errno+10054+++++++++++++++++++++++++++++&spm=1018.2226.3001.4187icon-default.png?t=M276https://blog.csdn.net/weixin_43945983/article/details/110882074?ops_request_misc=%257B%2522request%255Fid%2522%253A%2522164826372916782089376120%2522%252C%2522scm%2522%253A%252220140713.130102334..%2522%257D&request_id=164826372916782089376120&biz_id=0&utm_medium=distribute.pc_search_result.none-task-blog-2~all~sobaiduend~default-1-110882074.142^v5^pc_search_result_control_group,143^v6^control&utm_term=+OpenSSL+SSL_read%3A+Connection+was+reset%2C+errno+10054+++++++++++++++++++++++++++++&spm=1018.2226.3001.4187

你可能感兴趣的:(人工智能,python,paddlepaddle,paddle)