Replies: 2 comments 1 reply
-
Update: I'm able to build and use from Python https://github.com/LaurentMazare/tch-ext, which uses pyO3 0.18.3. I've tried to make my repo identical to his (including down grading pyo3 I think) but mine still fails and I'm not sure why. I'm guessing this is user error or perhaps a quirk in trch-rs? Let me know if you'd like me to close it and move it over there for troubleshooting. I wasn't sure if this was more pyo3 related or tch related. |
Beta Was this translation helpful? Give feedback.
-
I ran into a similar issue. In my case I'm using cuda directly instead of Using Process Monitor I figured out which DLL files This got everything working, at least when using I don't yet know:
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Bug Description
If tch-rs is used in a rust project, Python cannot import that module. Rust side works fine and compiles and the test of the function works.
I've built the project by using Libtorch manual install, debug version (controlled by environment variable set to my debug path for LIBTORCH and for appending to PATH). I'm using the msvc toolchain. Attempting to build with the pytorch from the venv fails on the rust side, the Libtorch install seems more stable. My rust test is able to use the lib.rs successfully to print the Cuda device.
If I change the rust lib.rs file to not have
use tch;
and to print something else instead of torch it works fine in python and prints what I want to print.Steps to Reproduce
Backtrace
Your operating system and version
Windows 10 Home - 10.0.19045 N/A Build 19045
Your Python version (
python --version
)3.9.10
Your Rust version (
rustc --version
)rustc 1.72.0 (5680fa18f 2023-08-23)
Your PyO3 version
0.19.2
How did you install python? Did you use a virtualenv?
python.org installer I think, I've had this version for a long time so I'm not sure. I am using a venv.
Additional Info
No response
Beta Was this translation helpful? Give feedback.
All reactions