1. 查看Cuba版本
方法一
``` nvidia-smi ``` 找到CUDA Version方法二
Nvidia Control Panel > 系统信息 > 组件 >
2. 安装Cuba匹配版本的PyTorch
https://pytorch.org/get-started/locally/
这里使用conda安装
conda install pytorch torchvision torchaudio pytorch-cuda=11.6 -c pytorch -c nvidia
## pip install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu116
3. 异常情况
![在这里插入图片描述](https://img-blog.csdnimg.cn/b7578413e7b542e0b5adb6ccbdef249c.jpeg#pic_center)
Collecting package metadata (current_repodata.json): \ ERROR conda.auxlib.logz:stringify(163): Expecting value: line 1 column 1 (char 0)
conda config --show-sources
删除指定文件,再运行上面命令回显空白
重新安装PyTorch
- download some necessary tools
pip install pycocotools-windows -i https://pypi.tuna.tsinghua.edu.cn/simple
pip install -r requirements.txt
pip install pyqt5
-
Create a new interpreter based on Anaconda3 python
-
安装依赖
pip install -r .\requirements.txt
- Other Exceptions
Error
>> ImportError: cannot import name 'COMMON_SAFE_ASCII_CHARACTERS' from 'charset_normalizer.constant' (D:\ProgramData\Anaconda3\envs\yolov7\lib\site-packages\charset_normalizer\constant.py)
pip install chardet
>> _pickle.UnpicklingError: STACK_GLOBAL requires str
删labels文件夹同层的labels.cache
>> torch.meshgrid warning
https://github.com/WongKinYiu/yolov7/pull/1167/commits/109fee31c97ef334a682f06c976ff7c9bf25d87d
- yv, xv = torch.meshgrid([torch.arange(ny), torch.arange(nx)])
+ yv, xv = torch.meshgrid([torch.arange(ny), torch.arange(nx)], indexing='ij')
- d