Skip to content
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

Can not find Python 3.7 #34

Closed
bine0josi opened this issue Apr 6, 2021 · 5 comments
Closed

Can not find Python 3.7 #34

bine0josi opened this issue Apr 6, 2021 · 5 comments

Comments

@bine0josi
Copy link

Hey,
I am currently trying to get the whole set up done and somehow (I think I followed all the steps in the docu correctly) the installed python can not be found when I try to run the example from git (FashionMnistClassification).
I always get this exception:
LostTech.Gradient.GradientInitializationException: 'Python 3.6+ not found. Install it globally, or use GradientEngine to configure Python home to use a different environment.'

I am using Visual Studio 19 Community. First I got Python over the VS Installer, but it did not work. Now I installed it manually (but also v3.7), also I ran the pip to install tensorflow and there I got this message when trying to import it to python:
grafik

I think this message is "fine" because I installed the cpu and not the gpu version.
Then I added the NuGet package for losttech and this seems to be fine because I do not have any errors in the example code.
Am I still missing something?

Kind regards and sorry for the maybe stupid question,
Philippine

@lostmsu
Copy link
Contributor

lostmsu commented Apr 6, 2021

@bine0josi you can always use GradientEngine.UseEnvironment(env) (as suggested in the error message) to explicitly specify which Python should be used.

You did not mention the TensorFlow version you installed. Latest release requires 1.15.*, and will simply ignore Python environments with TensorFlow 2.0+. We are expecting the first alpha working with 2.4 in a week or two.

We use WhichPython to find environments. Its repository has a trivial console app, that you can run to see how it searches for Python installations and what it finds.

@lostmsu lostmsu pinned this issue Apr 6, 2021
@lostmsu
Copy link
Contributor

lostmsu commented Apr 6, 2021

Specifically, since you are not using Conda, I recommend using PythonEnvironment.FromInterpreterChecked(path_to_python_exe).

@bine0josi
Copy link
Author

Thank you, now python was found.
Now I get this error message:
grafik
The inner exception is: Win32Exception: %1 is not a valid Win32Application
Any idea how I can fix that?
I checked the data in env and there it seems that the python37.dll was fund correctly.
grafik

Thank you in advance.
By the way, I installed Tensorflow 1.15

@lostmsu
Copy link
Contributor

lostmsu commented Apr 7, 2021

@bine0josi looks like your C# app starts as 32 bit. It needs to be 64 bit. You can check bitness as 8 * IntPtr.Size.

To get 64 bit, this setting in project properties must be off. And you must be running .NET Framework or 64 bit .NET Core
32 bit

@bine0josi
Copy link
Author

Thank you so much, now everything works fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants