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

When training the yolo dataset on pycharm, running train.py reports an error:

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]

Solution:

Find the functional.py file in the virtual environment used by pyrcharm, and find the functional 504 line according to the error message

Add code indexing = ' ij '

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

Although this seems to be the source code in the torch package, it should not be changed logically, but the problem is indeed solved

Reference article: YOLO UserWarning: torch.meshgrid: in an upcoming release, it will be required to pass the indexing a_shieres' blog-CSDN Blog

Guess you like

Origin blog.csdn.net/weixin_51972142/article/details/130664816