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

module 'tensorflow.keras.layers' has no attribute 'AbstractRNNCell' #65

Open
Pasha-Akito opened this issue May 13, 2024 · 2 comments
Open

Comments

@Pasha-Akito
Copy link

Hi,

I'm following this guide on using LTC with tensorflow: https://ncps.readthedocs.io/en/latest/examples/tf_first_steps.html

When running the imports as described here, I run into an issue, in particular this import: from ncps.tf import LTC

I get the following error: AttributeError: module 'tensorflow.keras.layers' has no attribute 'AbstractRNNCell'

From looking into it, it seems like tensorflow no longer supports AbstractRNNCell, this is fine as I can downgrade my tensorflow version to one which does support AbstractRNNCell.

My question is whether or not there is any intention of fixing this for newer tensorflow versions?

Thanks

@noorchauhan
Copy link

noorchauhan commented May 14, 2024

Yes I have faced similar issues, downgrading the Tensorflow works but that's not the good workaround, the ncp package needs to be updated for the same correction.

For start you can try other supporting versions of tensorflow.

@mlech26l , @raminmh Any insights on this bug?

@gabewillen
Copy link

This is actually a fairly simple fix. AbstractRNNCell was just an abstract class (Protocol) with methods stubbed out that the RNN class requires for a cell. To fix this simply replace tf.keras.layers.AbstractRNNCell with tf.keras.layers.Layer

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

4 participants
@Pasha-Akito @noorchauhan @gabewillen and others