【YOLO问题记录】UserWarning: torch.meshgrid: in an upcoming release,it will be required to pass the……

在pycharm上训练yolo数据集的时候,运行train.py报错:

D:\Applications\anaconda3\envs\pytorch\lib\site-packages\torch\functional.py:504: UserWarning: torch.meshgrid: in an upcoming release, it will be required to pass the indexing argument. (Triggered internally at C:\cb\pytorch_1000000000000\work\aten\src\ATen\native\TensorShape.cpp:3484.)
return _VF.meshgrid(tensors, **kwargs)  # type: ignore[attr-defined]

解决方法:

找到pyrcharm所用的虚拟环境下的functional.py文件,根据报错的提示找到functional的504行

加上代码indexing = ‘ij’

return _VF.meshgrid(tensors, **kwargs,indexing = 'ij')  # type: ignore[attr-defined]

虽然这好像是torch包里的源码,按道理说不应该改,但是确实问题解决了

参考文章:YOLO UserWarning: torch.meshgrid: in an upcoming release, it will be required to pass the indexing a_shieres的博客-CSDN博客

文章出处登录后可见!

已经登录?立即刷新

共计人评分,平均

到目前为止还没有投票!成为第一位评论此文章。

(0)
扎眼的阳光的头像扎眼的阳光普通用户
上一篇 2023年11月13日
下一篇 2023年11月13日

相关推荐