YOLOv8 project reasoning from CPU to GPU

#YOLOv8 project reasoning from CPU to GPU
YOLOv8 enters the pit and exits the pit, Nvidia graphics cards are available, ATI and other graphics cards can be skipped and swiped away! ! !
Connect YOLOv8 code to debug and run actual combat

1. Run the test

Run E:\AI\yolo\yolov8\ultralytics-main\ultralytics\yolo\v8\detect\predict.py and
insert image description here
the result is as shown in the figure below, using CPU for inference.

insert image description here

2. Check the Pytorch version

Enter the yolov8 virtual environment: conda activate yolov8
check the Pytorch version:pip list
insert image description here
insert image description here

3. Install CUDA

Nvidia graphics cards are available, and other graphics cards such as ATI can be skipped directly! ! !
Check the CUDA version supported by the graphics card: nvidia-smi
insert image description here
My computer graphics card supports CUDA Version up to 11.0,
so I installed CUDA11.0
CUDA download link
insert image description here
Choose according to your operating system, architecture, version, and installation method.
insert image description here
Uninstall all NIVIDIA software while downloading, and then install it again. The specific installation process is too much on the Internet, so I ignored it. But be sure to remember your own installation directory, which will be used below.
insert image description here
After the installation is complete, test the command:nvcc -V

4. Install cuDNN

cuDNN download link
insert image description here
Unzip it, copy the bin, include and lib, and paste it into the CUDA installation directory.
insert image description here
insert image description here

5. Install PyTorch

Go to the PyTorch link
Select the command with +cu
insert image description here
Use the install command

pip install torch==1.7.1+cu110 torchvision==0.8.2+cu110 torchaudio==0.7.2 -f https://download.pytorch.org/whl/torch_stable.html

insert image description here

Check the Pytorch version:pip list
insert image description here

##6. Run the test
Run E:\AI\yolo\yolov8\ultralytics-main\ultralytics\yolo\v8\detect\predict.py
insert image description here
is the GPU!
insert image description here

7. View the results

insert image description here
insert image description here
insert image description here
Done! ! !

Supongo que te gusta

Origin blog.csdn.net/qq_26938321/article/details/128697956
Recomendado
Clasificación