Install paddledetection locally (including various error reports)

Create an anaconda virtual environment

  • Create a virtual environment named paddle_env

conda create -n paddle_env python=3.7.3
  • Activate virtual environment

activate paddle_env

Check the cuda version (cuda and cudnn are installed by default in this article)

  • View the command (the author installed cuda11.2 version)

nvcc -V

installation steps

  • For CUDA 11.2 , it needs to be paired with cuDNN 8.2.1. The installation command is:

conda install paddlepaddle-gpu==2.4.2 cudatoolkit=11.2 -c https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/Paddle/ -c conda-forge
  • The successful installation of paddlepaddle is displayed (no errors have been reported so far)

2.4.2

Install paddledetection (emphasis)

  • Install pycocotools

pip install pycocotools-windows # 使用这个命令,作者报错了
  • The error message shows that the version is not specified. We can change the command (the installation of pycocotools is successful)

pip3 install pycocotools -i https://pypi.tuna.tsinghua.edu.cn/simple/ --trusted-host pypi.tuna.tsinghua.edu.cn
  • Download it locally and unzip it

  • Because we have installed pycocotools before, and requirements.txt contains pycocotools, we have to go into the txt file and delete it.

  • cd to the directory with requirements.txt, install other dependencies, enter:

pip install -r requirements.txt # 输入后显示报错

  • There is a pit here. If you directly enter pip install -r requirements.txt, an error will be reported.

  • The reason is that the requirements.txt file needs to be created before executing this statement, so it must be executed first

pip freeze > requirements.txt

can only be executed after

pip install -r requirements.txt
  • But after entering pip install -r requirements.txt in this step, the error message was displayed again, which was numb. . . It was very crashing, but it was finally solved. The error displayed was

  • At this time we need to open requirements.txt

  • The solution is to manually delete the download link in the requirement.txt file

  • Then enter again

pip install -r requirements.txt

At this point, the requirements.txt file has been successfully installed. It is indeed not easy.

  • Next enter python setup.py install

python setup.py install

paddledetection安装成功

哪块有错误的话,欢迎在评论区指正

Guess you like

Origin blog.csdn.net/Edenms/article/details/129735889