YOLOV8环境部署(GPU版本)

一、安装cuda和cudnn

1、安装cuda之前先打开英伟达控制面板查看自己的显卡信息

2、“帮助”—>“系统信息”—>“组件”,然后看第三行的信息“Nvidia CUDA 12.4”

3、进入英伟达官网“CUDA Toolkit Archive | NVIDIA Developer”,我的是12.4

下载完成后nvcc -V检查一下是否安装正确

nvcc -V

查看是否配置环境变量

二、下载CUDNN

cuDNN Archive | NVIDIA Developer

下载好了过后把解压出来放到CUDAv12.4安装目录下

然后配置环境变量

D:\daima\CUDAv12.4\bin
D:\daima\CUDAv12.4\extras\CUPTI\lib64

三、安装pytorch(带GPU)

PyTorch

1、

2、

3、找到这个,我的是12.4,安装12.1的也行

4、安装ultralytics

pip install ultralytics

5、因为ultralytics自带是cpu的我们需要卸载cpu版本的pytorch

pip uninstall torch

6、安装第三步复制的内容

conda install pytorch==2.2.2 torchvision==0.17.2 torchaudio==2.2.2 pytorch-cuda=12.1 -c pytorch -c nvidia

7、可以测试一下了(如果不行看最下面)

import ultralytics
ultralytics.checks()

import torch
print(torch.__version__)
print(torch.cuda.is_available())
print(torch.cuda.device_count())

OK

安装后报错:ImportError: cannot import name 'COMMON_SAFE_ASCII_CHARACTERS' from 'charset_normalizer.constant' (D:\daima\anaconda3\yolo\lib\site-packages\charset_normalizer\constant.py)

pip install chardet

安装后报错:

    raise RuntimeError('''
RuntimeError: 
        An attempt has been made to start a new process before the
        current process has finished its bootstrapping phase.

        This probably means that you are not using fork to start your
        child processes and you have forgotten to use the proper idiom
        in the main module:

            if __name__ == '__main__':
                freeze_support()
                ...

        The "freeze_support()" line can be omitted if the program
        is not going to be frozen to produce an executable.

需要拿 if __name__ == '__main__':包起来

其它报错:建议测试把works调成1

YOLO5模型训练过程_mac训练yolov5-CSDN博客

YOLO5 6.1版本报错解决_ranges = np.round(np.linspace(8, 4, 10), 0).astype-CSDN博客

  • 8
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值