赞
踩
在使用CLI命令运行yolov8时出现错误TypeError: torch._VariableFunctionsClass.meshgrid() got multiple values for keyword argument 'indexing'
解决方法:
1. 升级pytorch版本
pip install --upgrade torch
2. 升级版本后可能会遇见 pip 的依赖包和新安装的包有冲突的问题,如下所示:
- ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
- torchaudio 2.1.0 requires torch==2.1.0, but you have torch 2.2.1 which is incompatible.
- torchvision 0.16.0 requires torch==2.1.0, but you have torch 2.2.1 which is incompatible.
此时只需要将上述的包再次升级即可,运行下面代码
pip install --upgrade torchaudio torchvision
3. 最后解决问题,使用CLI重新运行,得到结果
- (pytorch) D:\research\ultralytics-main>yolo detect predict model=yolov8x.pt source="D:/research/ultralytics-main/yanzheng.jpg" save=True
- 推荐阅读
相关标签
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。