Skip to content

Running tutorials on MacOS results in error. #1424

@NiklasGustafsson

Description

@NiklasGustafsson

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'

Installed Packages
libtorch-cpu-osx-arm64, 2.5.1
TorchSharp-cpu, 0.105.0

Error: System.TypeInitializationException: The type initializer for 'TorchSharp.torch' threw an exception.
---> System.NotSupportedException: The libtorch-cpu-osx-arm64 package version 2.5.1.0 is not restored on this system. If using F# Interactive or .NET Interactive you may need to add a reference to this package, e.g.
#r "nuget: libtorch-cpu-osx-arm64, 2.5.1.0". Trace from LoadNativeBackend:

TorchSharp: LoadNativeBackend: Initialising native backend, useCudaBackend = False

This only seems to happen on MacOS, running tutorials on Windows works fine.

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions