DLL loading issue
See original GitHub issueI have a following script:
#r "nuget: libtorch-cpu, 1.8.0.7"
#r "nuget: TorchSharp, 0.91.52604"
open TorchSharp
[<AutoOpen>]
module Helpers =
let inline fscalar x = TorchScalar.op_Implicit (float32 x)
let torch_pi = fscalar 3.14
printfn $"{torch_pi.ToDouble()}"
Without explicitly configured LD_LIBRARY_PATH I get
#> dotnet fsi test.fsx
System.DllNotFoundException: Unable to load shared library 'LibTorchSharp' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: libLibTorchSharp: cannot open shared object file: No such file or directory
at TorchSharp.ScalarExtensionMethods.THSTorch_float32_to_scalar(Single value)
at TorchSharp.ScalarExtensionMethods.ToScalar(Single value)
at TorchSharp.TorchScalar.op_Implicit(Single value)
at <StartupCode$FSI_0002>.$FSI_0002.main@()
Stopped due to error
…but with explicit paths, it works as expected:
#> LD_LIBRARY_PATH=/home/peter/.nuget/packages/libtorch-cpu/1.8.0.7/runtimes/linux-x64/native/ dotnet fsi test.fsx
3.140000104904175
Issue Analytics
- State:
- Created 2 years ago
- Comments:9 (9 by maintainers)
Top Results From Across the Web
Methods to Fix Error in Loading DLL at Startup
Part 1. How to Fix Error in loading DLL at Startup · Solution 1: Reinstall the program · Solution 2: Clear and repair...
Read more >Error in loading DLL when using Access wizard
Cause. This problem may occur if you have missing Microsoft Data Access Components (MDAC) files, corrupted MDAC files, or outdated MDAC files on ......
Read more >Access Database Error in Loading DLL – Easy Solutions
How to Fix Access Database 'Error in Loading DLL'? · Solution 1: Try Registering the Dao360 and Msado15 DLL Files · Solution 2:...
Read more >System DLL 'dll' could not be loaded (Error 298)
The file isn't on the proper path. Ensure the DLL is on the Windows System path. · The DLL is corrupted or was...
Read more >Failed to load DLL file on Windows 11/10 computer
Failed to load DLL file on Windows · 1] Reinstall the program. Reinstall the program which is throwing this error. · 2] Check...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’ve submitted a PR for the fix to this problem. Most factories already had the initialization logic, but ToScalar() and the from() variant that takes a list of .NET scalars did not.
Yes. Sorry, I removed that comment because it didn’t add anything new to discussion.
Above, you already said: “before all tensor and scalar creation routines”