Usage of torch.solve is deprecated
See original GitHub issueš Bug (waiting to happen)
Kornia is using a deprecated function from torch, triggering this UserWarning below:
..../python3.9/site-packages/kornia/utils/helpers.py:96: UserWarning: torch.solve is deprecated in favor of torch.linalg.solveand will be removed in a future PyTorch release.
torch.linalg.solve has its arguments reversed and does not return the LU factorization.
To get the LU factorization see torch.lu, which can be used with torch.lu_solve or torch.lu_unpack.
X = torch.solve(B, A).solution
should be replaced with
X = torch.linalg.solve(A, B) (Triggered internally at /pytorch/aten/src/ATen/native/BatchLinearAlgebra.cpp:760.)
We could substitute the line at utils/helpers.py:96
from:
out1, out2 = torch.solve(input.to(dtype), A.to(dtype))
to:
out1 = torch.linalg.solve(A.to(dtype), input.to(dtype))
out2 = ?
Unfortunatly the docs arenāt explaining and I couldnāt discover a way to get to out2, but then again, i have no experience with pytorch.
Environment
PyTorch version: 1.9.0+cpu Is debug build: False CUDA used to build PyTorch: Could not collect ROCM used to build PyTorch: N/A
OS: Ubuntu 20.04.3 LTS (x86_64) GCC version: (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0 Clang version: Could not collect CMake version: Could not collect Libc version: glibc-2.31
Python version: 3.9.5 (default, May 18 2021, 19:34:48) [GCC 7.3.0] (64-bit runtime) Python platform: Linux-5.11.0-25-generic-x86_64-with-glibc2.31 Is CUDA available: False CUDA runtime version: Could not collect GPU models and configuration: GPU 0: NVIDIA GeForce MX230 Nvidia driver version: 470.57.02 cuDNN version: Could not collect HIP runtime version: N/A MIOpen runtime version: N/A
Versions of relevant libraries: [pip3] mypy==0.902 [pip3] mypy-extensions==0.4.3 [pip3] numpy==1.19.5 [pip3] pytorch-lightning==1.3.7.post0 [pip3] torch==1.9.0+cpu [pip3] torchaudio==0.9.0 [pip3] torchmetrics==0.3.2 [pip3] torchsummary==1.5.1 [pip3] torchtext==0.10.0 [pip3] torchvision==0.10.0+cpu [conda] Could not collect
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:9 (6 by maintainers)
Top GitHub Comments
Iāve changed github.actions requirements to torch==1.8.0 and now it works. The only problem is that it should work with 1.7.1, but it does not š
Happy to hear that. Thatās weird that only happens in GH actions. Maybe the version cashing is not well resolved.