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

BadImageFormatException

Open nadavbeno opened this issue 4 years ago • 1 comments

Hi, I'm running .Net 4.8 and python 3.8.6. When I try to run the first code, I get this exception.

Unhandled Exception: System.BadImageFormatException: Could not load file or assembly 'Python.Runtime, Version=2.5.1.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. An attempt was made to load a program with an incorrect format. at Numpy.np.array[T](T[,] object, Dtype dtype, Nullable1 copy, String order, Nullable1 subok, Nullable1 ndmin)`

I've tried to install pythonnet_38 but no success. Does the Keras.Net support python version >3.7? What can I do to fix this?

nadavbeno avatar Jan 07 '21 03:01 nadavbeno

Has anyone found a solution? I get the exact same error. I have tried different python installations, different pythonnet installations, setting the project to x86. I could produce that error on another computer with a new project, which only callsNDarray x = np.array(new double[]{ 589.1, 574.92} Weirdly, the code works on my colleagues' computers. I suspect that something is wrong with the Python.Runtime.dll but I haven't found a solution.

Broccoli-Pr avatar Sep 06 '21 10:09 Broccoli-Pr

@nadavbeno I got this error when used 32-bit version of python. Reinstalling to x64 solved my problem

win7user10 avatar Nov 13 '22 16:11 win7user10

Stale issue message

github-actions[bot] avatar Sep 03 '23 00:09 github-actions[bot]