问题描述:训练网络时报错:
UserWarning: torch.meshgrid: in an upcoming release, it will be required to pass the indexing argument. (Triggered internally at ..\aten\src\ATen\native\TensorShape.cpp:2157.)
return _VF.meshgrid(tensors, **kwargs) # type: ignore[attr-defined]
翻译: torch.meshgrid:在即将发布的版本中,它将需要传递索引参数。
解决方法:在使用torch.meshgrid的位置加上indexing = 'ij'即可。例:
y, x = torch.meshgrid(y, x, indexing = 'ij')