Keras.NET icon indicating copy to clipboard operation
Keras.NET copied to clipboard

How to configure python environments on linux

Open rcoconnor opened this issue 3 years ago • 2 comments

Hello, I am using the dotnet cli on Linux to run this project and I am trying to load a model I already built using python; however, I am receiving an error when I run the project telling me that it is unable to load the shared library 'python38'. I believe this is due to the fact that my python3.8 environment is a conda environment; therefore, I think I would only have to configure which python environment it should be using. Is there a way to select which conda environment my project should load? How would I go about resolving this issue?

Steps to reproduce

  1. Create a new solution and project
  2. install keras.net
  3. in main function, add the following code var model = Keras.Models.Model.LoadModel("pathtomodel.json");
  4. run the project

I am receiving the following error: Error Message: System.DllNotFoundException : Unable to load shared library 'python38' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: libpython38: cannot open shared object file: No such file or directory

rcoconnor avatar Jan 02 '22 20:01 rcoconnor

Any luck solving this?

Jamminroot avatar Feb 03 '22 22:02 Jamminroot

Well, nvm, figured this out.

For anyone wondering - things I changed in order to fix the problem is target framework (I think I ended with net5.0), and manually and explicitly adding nuget for my platform (pythonnet 38, linux 64 in my case)

Jamminroot avatar Feb 04 '22 08:02 Jamminroot

Stale issue message

github-actions[bot] avatar Jun 03 '23 00:06 github-actions[bot]