dotnet / machinelearning

ML.NET is an open source and cross-platform machine learning framework for .NET.
https://dot.net/ml
MIT License
9.04k stars 1.89k forks source link

Unable to load shared library 'MklImports' on MacOS with CLI #7229

Open thomasd3 opened 2 months ago

thomasd3 commented 2 months ago

I am using the CLI tool, on MacOS.

My command line is:

mlnet forecasting --dataset training.csv --validation-dataset testing.csv --train-time 100 --label-col 1 --time-col 0 --horizon 1 --has-header true

I went to: https://learn.microsoft.com/en-us/dotnet/machine-learning/how-to-guides/install-extra-dependencies

and installed the dependency with:

wget https://raw.githubusercontent.com/Homebrew/homebrew-core/fb8323f2b170bd4ae97e1bac9bf3e2983af3fdb0/Formula/libomp.rb && brew install ./libomp.rb && brew link libomp --force

libomp is installed, I've also installed the MKL lib from Intel just in case, but I keep getting a crash:

System.DllNotFoundException: Unable to load shared library 'MklImports' or one of its dependencies. In order to help diagnose loading problems, consider setting the DYLD_PRINT_LIBRARIES environment variable:                                               dlopen(/Users/thomas/.dotnet/tools/.store/mlnet-osx-x64/16.18.2/mlnet-osx-x64/16.18.2/tools/net8.0/any/MklImports.dylib, 0x0001): tried: '/Users/thomas/.dotnet/tools/.store/mlnet-osx-x64/16.18.2/mlnet-osx-x64/16.18.2/tools/net8.0/any/MklImports.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Users/thomas/.dotnet/tools/.store/mlnet-osx-x64/16.18.2/mlnet-osx-x64/16.18.2/tools/net8.0/any/MklImports.dylib' (no such file), '/Users/thomas/.dotnet/tools/.store/mlnet-osx-x64/16.18.2/mlnet-osx-x64/16.18.2/tools/net8.0/any/MklImports.dylib' (no such file)

What am I missing?

sventropy commented 3 weeks ago

I just stumbled over the same issue.

Are you running Apple Silicon (arm64)? If so, the time series SSA model is only supported on Intel x64, due to a dependency on the Intel SDK. Check out https://github.com/dotnet/machinelearning/blob/main/docs/project-docs/platform-limitations.md

thomasd3 commented 3 weeks ago

I am on Intel x64.