6

I am trying to execute LIIF(https://github.com/yinboc/liif) and the following warning appears:

/usr/local/lib/python3.7/dist-packages/torch/functional.py:445: 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]
Pep Bravo
  • 67
  • 1
  • 2
  • 9

2 Answers2

1

Change it to

return _VF.meshgrid(tensors, **kwargs, indexing="ij")
Ryan M
  • 18,333
  • 31
  • 67
  • 74
FreeToGo
  • 360
  • 5
  • 8
0

My answer might not be the direct solution, but can be somehow relevant. I met the same warning but it was caused by calling torch.cartesian_prod(*tensors).

/opt/conda/lib/python3.7/site-packages/torch/functional.py:1069: UserWarning: torch.meshgrid: in an upcoming release, it will be required to pass the indexing argument. (Triggered internally at  /opt/conda/conda-bld/pytorch_1634272168290/work/aten/src/ATen/native/TensorShape.cpp:2157.)return _VF.cartesian_prod(tensors)  # type: ignore[attr-defined]

From my personal experience, I could not find any relatives between _VF.cartesian_prod and meshgrid, but the warning is there. Some other guys have encountered this, and see pytorch issue #50276. The engineer from Pytorch promised to take a look at it, but I guess they may ignore (or perhaps forget) this.

So I believe this may not be a serious problem and hinder the usage of Pytorch. Just go ahead with it and see whether in the future release, any new arguments (e.g., index) are needed.

Fang WU
  • 180
  • 2
  • 7