[yolov series: Xiaobai yolov7 running data set creation environment]

First, get other people's source code from github.
This is the source code package of github. Download and decompress it directly. Open
the decompressed folder and you should be able to see this page.
Enter the requirements.txt page of the folder
Insert image description here

This article is to record your own environment configuration process and use it as a note. There are currently many installation tutorials on the Internet, but if it involves more details, it may not be so easy, so make a note first. use.

First, win+r, cmd
Insert image description here
to enter. The prerequisite for these is that your computer has conda.

conda create -n yolov7 python=3.8

Among them, yolov7 is the name of the environment. The version of python is 3.8. It can also be 3.7 or 3.6 and 3.9. However, when it comes to the operation of many programs on the current network, version 3.8 is the most common.
Insert image description here
Enter y to confirm
Insert image description here
and then copy the file path Insert image description here
and cd your own path.

cd C:\Users\ljx\Desktop\yolov7-main\yolov7-main

Then use the command:
pip install -r requirement.txt -i https://pypi.tuna.tsinghua.edu.cn/simpleInsert image description here
Next check the cuda version and install the corresponding torch version.
Open a new window win+r, cmd OK, enter

nvidia-smi

Insert image description here
The cuda version I have here is version 12.0, so go to the official website to find the corresponding torch command.
Enter the pytorch official website to select the version https://pytorch.org/
Higher versions of pytorch are generally compatible with lower versions of cuda.
For example: you need pytorch 1.7.0, then cuda can only be 11.0 and below. The officially recommended CUDA versions are 10.2 and 11.3. These two CUDA versions support most pytorch versions.
Insert image description here
The download commands for each version are different.
Provide a reprinted article for use.
Corresponding versions of Pytorch and cuda
There are two options available here, depending on which one is suitable for your computer.
CUDA 11.6

pip install torch==1.12.0+cu116 torchvision==0.13.0+cu116 --extra-index-url https://download.pytorch.org/whl/cu116 

I am using CUDA 11.3

pip install torch==1.12.0+cu113 torchvision==0.13.0+cu113 --extra-index-url https://download.pytorch.org/whl/cu113 

It will be successful, then just put it in the interpreter, open pycharm, and click the interpreter in the lower right corner. Click below to replace successfully.
Insert image description here
Insert image description here

Guess you like

Origin blog.csdn.net/weixin_47869094/article/details/132249516