question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItĀ collects links to all the places you might be looking at while hunting down a tough bug.

And, if youā€™re still stuck at the end, weā€™re happy to hop on a call to see how we can help out.

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:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:9 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
smivvcommented, Sep 1, 2021

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 šŸ˜ƒ

0reactions
edgarribacommented, Sep 2, 2021

Happy to hear that. Thatā€™s weird that only happens in GH actions. Maybe the version cashing is not well resolved.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Torch.solve is deprecated Ā· Discussion #1196 Ā· kornia ... - GitHub
solve is deprecated in favor of torch.linalg.solveand will be removed in a future PyTorch release. torch.linalg.solve has its arguments reversedĀ ...
Read more >
torch.linalg.solve ā€” PyTorch 1.13 documentation
torch.linalg.solve(A, B, *, left=True, out=None) ā†’ Tensor. Computes the solution of a square system of linear equations with a unique solution.
Read more >
userwarning: torch.eig is deprecated in favor of ... - You.com
It seems modifying G, _ = torch.solve(P, R) to G = torch.linalg.solve(R, P) does the trick.
Read more >
How can I solve "torch.utils.ffi is deprecated. Please use cpp ...
ImportError: torch.utils.ffi is deprecated. Please use cpp extensions instead. I have been searching solution on the online. The problem is theĀ ...
Read more >
PyTorch - Browse /v1.12.0 at SourceForge.net
Please use PyTorch Quantization to quantize the Linear module instead. ... torch.solve which was deprecated in a previous release is now being removed....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found