配置yolov5时遇到的一些问题和解决方案

本人用的是cuda11.3,未用conda,时间2022.4.3

1.不要直接在cmd里输入pip install pytorch,这样安装的pytorch是cpu版本

可以pip uninstall pytorch卸载了

应该用

pip3 install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu113

2.如果有python的虚拟环境,需要在该虚拟环境下文件夹下打开cmd再安装

3.在pycharm的terminal中安装pytorch和pytorchvision遇到UnicodeDecodeError: 'gbk' codec can't decode byte 0x98 in position 1027: illegal multibyte sequence

需要在Windows里的cmd安装(配合2)

4.运行detect.py遇到NotImplementedError: Could not run 'torchvision::nms' with arguments from the 'CUDA' backend. This could be because the operator doesn't exist for this backend, or was omitted during t
he selective/custom build process (if using custom build). If you are a Facebook employee using PyTorch on mobile, please visit https://fburl.com/ptmfixes for possible resolutions. 'to
rchvision::nms' is only available for these backends: [CPU, QuantizedCPU, BackendSelect, Python, Named, Conjugate, Negative, ZeroTensor, ADInplaceOrView, AutogradOther, AutogradCPU, AutogradCUDA, AutogradXLA, AutogradLazy, AutogradXPU, AutogradMLC, AutogradHPU, Tracer, AutocastCPU, Autocast, Batched, VmapMode, Functionalize].

卸载pytorch:pip uninstall pytorch(配合2)

重新安装

pytorchvision0.12.0+cu113(配合1、2)

pip install torchvision==0.12.0+cu113 -f https://download.pytorch.org/whl/torch_stable.html

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值