在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包里的源码,按道理说不应该改,但是确实问题解决了文章来源:https://www.toymoban.com/news/detail-751849.html
参考文章:YOLO UserWarning: torch.meshgrid: in an upcoming release, it will be required to pass the indexing a_shieres的博客-CSDN博客文章来源地址https://www.toymoban.com/news/detail-751849.html
到了这里,关于【YOLO问题记录】UserWarning: torch.meshgrid: in an upcoming release,it will be required to pass the......的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!