-
Notifications
You must be signed in to change notification settings - Fork 282
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
keras via tensorflow :: 2.13 :: AttributeError: module 'tensorflow.keras' has no attribute '__version__' #1370
Comments
Just an update, I can confirm that downgrading my python install of tensorflow/keras to From R: > keras:::keras_version()
2023-07-13 10:18:56.477483: I tensorflow/core/platform/cpu_feature_guard.cc:193] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN) to use the following CPU instructions in performance-critical operations: AVX2 AVX512F FMA
To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.
[1] ‘2.11.0’
> system("pip list | grep -E '(keras|tensorflow)'")
keras 2.11.0
tensorflow 2.11.1
tensorflow-cpu 2.11.1
tensorflow-estimator 2.11.0
tensorflow-io-gcs-filesystem 0.32.0
> packageVersion("keras")
[1] ‘2.11.1’
> packageVersion("tensorflow")
[1] ‘2.11.0’
|
Can you please try with the development version of the R package? remotes::install_github("rstudio/keras") |
Perfect! Thanks! > keras:::keras_version()
2023-07-13 12:08:01.417687: I tensorflow/tsl/cuda/cudart_stub.cc:28] Could not find cuda drivers on your machine, GPU will not be used.
2023-07-13 12:08:01.493816: I tensorflow/tsl/cuda/cudart_stub.cc:28] Could not find cuda drivers on your machine, GPU will not be used.
2023-07-13 12:08:01.495103: I tensorflow/core/platform/cpu_feature_guard.cc:182] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.
To enable the following instructions: AVX2 AVX512F FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.
2023-07-13 12:08:02.784507: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT
[1] ‘2.13.0’
> system("pip list | grep -E '(keras|tensorflow)'")
keras 2.13.1
tensorflow 2.13.0
tensorflow-cpu 2.13.0
tensorflow-estimator 2.13.0
tensorflow-io-gcs-filesystem 0.32.0
> packageVersion("keras")
[1] ‘2.11.1.9000’
> packageVersion("reticulate")
[1] ‘1.30.9000’ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When using newer tensorflow python packages (2.13, probably also 2.12), loading keras package fails with:
AttributeError: module 'tensorflow.keras' has no attribute '__version__'
Granted...the current (https://packagemanager.posit.co/cran/__linux__/jammy/2023-07-12/) version of
R keras is 2.11.1, so this might just be a compatibility issue between
R keras 2.11.1 and Python tensorflow/keras > 2.11.1
From R:
From Python:
The text was updated successfully, but these errors were encountered: