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

Specify Python, Keras, and Tensorflow versions #259

Open
Darelbi opened this issue Mar 14, 2024 · 1 comment
Open

Specify Python, Keras, and Tensorflow versions #259

Darelbi opened this issue Mar 14, 2024 · 1 comment

Comments

@Darelbi
Copy link

Darelbi commented Mar 14, 2024

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

@KudaChan
Copy link

I am also having the same problem. The issue is with the Pythonnet Nuget package. version is mismatched. Don't know how to solve this.

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