-
Notifications
You must be signed in to change notification settings - Fork 32
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
Importing tf_keras
to use Keras 2 in TensorFlow 2.16 fails
#756
Comments
@MaxiBoether, Thank you! |
Thanks for the swift response. This leads to the same error as outlined. Note that I tried two things: |
Okay, I know what the issue is: By default (at least on my mac in a clean conda env), The version mismatch (if enforced on colab) leads to this error. |
I'm having the same issue; attempting
This seems to be the result of some in-process refactoring of At the moment, the default installs of
I've been trying to work around the incompatibility by reverting to a prior tensorflow release. I expect to be able to install out-of-date versions via
However, this approach is not working with tensorflow. I don't see anything obviously broken at PyPI, but I've not been able to install prior tensorflow releases via pip.
|
It appears 2.16.0rc0 is a pre-release version of tensorflow. Running the same commands on a different host (ubuntu under wsl) gives me
Overall:
With tensorflow 2.15.0.post1, |
When you use TensorFlow 2.16 with RC0 and testing Keras 2 path, please install The core of the issue is, in @robertbcalhoun - Can you try this and confirm? |
This issue is stale because it has been open for 14 days with no activity. It will be closed if no further activity occurs. Thank you. |
Just trying to avoid this issue becoming stale :-) |
This issue is stale because it has been open for 14 days with no activity. It will be closed if no further activity occurs. Thank you. |
System information.
Describe the problem.
huggingface transformers currently relies on Keras 2. They mention that install the
tf-keras
package can make Keras 2 APIs available in TF 2.16. The getting started page mentions something similar. In a clean environment, I install the following packages:Importing Keras 3.0 works as expected:
However, importing tf_keras fails with some error:
I can trigger the same error by forcing Tensorflow to use Keras 2 instead using
TF_USE_LEGACY_KERAS=1
and importing tensorflow.keras. I do not think this is supposed to happen. From my understanding, installingtf_keras
should enable us to use keras 2 in tf 2.16.The text was updated successfully, but these errors were encountered: