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

 在pycharm运行yoloV5中的train.py时遇到

F:\depth_study\anaconda\envs\pytorch\Lib\site-packages\torch\functional.py:513: 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:3610.)
  return _VF.meshgrid(tensors, **kwargs)  # type: ignore[attr-defined]

 解决方法:

      先点击F:\depth_study\anaconda\envs\pytorch\Lib\sitepackages\torch\functional.py:513

(这个看你电脑上的警告位置),位置会出现下列代码:

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

将其改为

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

应该可以解决当前问题

解析问题:

      这个警告的意思是当前的代码格式会与将来的pytorch版本不兼容,考虑到代码的可移植性,建议修改

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值