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

Specify Python, Keras, and Tensorflow versions

Open Darelbi opened this issue 4 months ago • 1 comments

I have been able to install the Keras.NET nuget package, guided by runtime exceptions I also installed

Python 3.8.10 (which is the last 3.8.x version that comes with a installer) added python to PATH.

I also installed PIP by running "python get-pip.py" script.

Here comes the problems:

I can use pip to install tensorflow and keras, HOWEVER the installed versions mismatch with Keras.NET, consequently

I get this error when I try to train a deep neural network:

: 'ValueError : decay is deprecated in the new Keras optimizer, please check the docstring for valid arguments, or use the legacy optimizer, e.g., tf.keras.optimizers.legacy.Adam.'

Then I try as optimizer the string

"tf.keras.optimizers.legacy.Adam"

and I go a step on => dude, still missing tensorflow.keras...

'ModuleNotFoundError : No module named 'tensorflow.keras''

AND THIS ONE IS NOT FOUND ON PIP

Installed also Tensorflow.Keras nuget package but then it keeps insisting saying

ImportError : No module named tensorflow

but if I do "pip show tensorflow" it shows tensorflow is installed, I can even run pure python example scripts with tensorflow

without effect.. that means i need to use even older versions?

SINCE NEWEST VERSIONS GIVES PROBLEMS I TRIED VERSIONS OF 2020: pip install keras==2.6.0 pip install tensorflow==2.3.2

but then i have this error: Python.Runtime.PythonException: 'TypeError : Descriptors cannot be created directly. If this call came from a _pb2.py file, your generated code is out of date and must be regenerated with protoc >= 3.19.0. If you cannot immediately regenerate your protos, some other possible workarounds are:

  1. Downgrade the protobuf package to 3.20.x or lower.
  2. Set PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python (but this will use pure-Python parsing and will be much slower).

More information: https://developers.google.com/protocol-buffers/docs/news/2022-05-06#python-updates'

SOMEHOW I MANAGED playing with numpy and protobuf libraries: here are my current packages:

absl-py 2.1.0 astunparse 1.6.3 cachetools 5.3.3 certifi 2024.2.2 charset-normalizer 3.3.2 flatbuffers 24.3.7 gast 0.3.3 google-auth 2.28.2 google-auth-oauthlib 1.0.0 google-pasta 0.2.0 grpcio 1.62.1 h5py 2.10.0 idna 3.6 importlib_metadata 7.0.2 keras 2.6.0 Keras-Applications 1.0.8 Keras-Preprocessing 1.1.2 libclang 16.0.6 Markdown 3.6 MarkupSafe 2.1.5 numpy 1.18.0 oauthlib 3.2.2 opt-einsum 3.3.0 packaging 24.0 pip 24.0 protobuf 3.20.0 pyasn1 0.5.1 pyasn1-modules 0.3.0 PyYAML 6.0.1 requests 2.31.0 requests-oauthlib 1.4.0 rsa 4.9 scipy 1.10.1 setuptools 69.2.0 six 1.16.0 tensorboard 2.14.0 tensorboard-data-server 0.7.2 tensorflow 2.3.2 tensorflow-estimator 2.3.0 tensorflow-io-gcs-filesystem 0.31.0 termcolor 2.4.0 typing_extensions 4.5.0 urllib3 2.2.1 Werkzeug 3.0.1 wheel 0.43.0 wrapt 1.16.0 zipp 3.18.1

Darelbi avatar Mar 14 '24 19:03 Darelbi