-
Notifications
You must be signed in to change notification settings - Fork 189
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Running tutorials on MacOS results in error. #1424
Comments
Hey @NiklasGustafsson , thanks for the report. By meaning the first invocation, are you referring this code section in the tutorial1.ipynb? using TorchSharp;
using static TorchSharp.torch.nn;
using static TorchSharp.torch.nn.functional;
using static TorchSharp.TensorExtensionMethods; I'm trying to verify if issue is related to |
No, you have to go farther down the notebook, when it first creates a tensor. Before then, nothing is run. I believe it has to do with .NET Interactive, and how TorchSharp loads the backend dynamically. For some reason, it's not affecting Windows (haven't tried tutorials on Linux). |
@NiklasGustafsson . So I have taken a look at this, I believe it is a problem with TorchSharp probing for it's native assemblies directly. The failure occurs down here. TorchSharp/src/TorchSharp/Torch.cs Line 87 in 3760ba3
In interactive we have assembly and native assembly resolution, which should resolve this fine, however, It looks to me, as if this TorchSharp API is failing aggressively, leaving us unable to do anything. It seems to me as if the issue, may have something to do with the MAC having universal and arm64 native package dependencies, which also seem to have differing package version numbers, but I may be wrong about that. I would however guess, that on a when using a non arm64 build on the mac, it will work as expected. |
More people with Mac need to check |
Here: TorchSharp/src/TorchSharp/Torch.cs Line 24 in 3760ba3
and here: |
Hey @KevinRansom thanks for the very fast repky. I tried correcting the hardcoded libtorch version in the code and it still failed. I opened the issue on dotnet interactive because when I try to use the packages in a non notebook project (like a console application in visual studio) this error does not happen. |
Trying to run tutorial1.ipynb on MacOS-Arm64
https://github.com/dotnet/TorchSharpExamples/blob/main/tutorials/CSharp/tutorial1.ipynb
results in an error on the first TorchSharp invocation. It's dynamically looking for the wrong libtorch version number, '2.5.1.0' instead of '2.5.1'
This only seems to happen on MacOS, running tutorials on Windows works fine.
The text was updated successfully, but these errors were encountered: