当前位置:   article > 正文

Yolov8(TypeError: torch._VariableFunctionsClass.meshgrid() got multiple values for keyword argument)_typeerror: meshgrid() got multiple values for keyw

typeerror: meshgrid() got multiple values for keyword argument 'indexing

在使用CLI命令运行yolov8时出现错误TypeError: torch._VariableFunctionsClass.meshgrid() got multiple values for keyword argument 'indexing'

解决方法:

1. 升级pytorch版本

 pip install --upgrade torch

2. 升级版本后可能会遇见 pip 的依赖包和新安装的包有冲突的问题,如下所示:

  1. 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.
  2. torchaudio 2.1.0 requires torch==2.1.0, but you have torch 2.2.1 which is incompatible.
  3. 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重新运行,得到结果

  1. (pytorch) D:\research\ultralytics-main>yolo detect predict model=yolov8x.pt source="D:/research/ultralytics-main/yanzheng.jpg" save=True
  2. Ultralytics YOLOv8.1.20 声明:本文内容由网友自发贡献,转载请注明出处:【wpsshop】
    推荐阅读
    相关标签