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

FAILED tests/test_deep_learning4e.py::test_rnn - AttributeError: module 'keras.preprocessing.sequence' #1262

Open
ailabuser opened this issue Sep 15, 2022 · 3 comments

Comments

@ailabuser
Copy link

ailabuser commented Sep 15, 2022

FAILED tests/test_deep_learning4e.py::test_rnn - AttributeError: module 'keras.preprocessing.sequence' has no attribute 'pad_sequences'

Need to replace 'keras.preprocessing.sequence' with 'keras_preprocessing.sequence'

Python 3.8.13, Tensorflow 2.10.0, Keras 2.10.0

@ailabuser ailabuser changed the title FAILED tests/test_deep_learning4e.py FAILED tests/test_deep_learning4e.py::test_rnn - AttributeError: module 'keras.preprocessing.sequence' Sep 15, 2022
@EnthusiasticTeslim
Copy link

EnthusiasticTeslim commented Oct 16, 2022

Yes, the py.test failed because of this issue. It is noteworthy to mention that the attribute has been moved to keras.utils in keras 2.9....In your deep_learning4e.py file, replace

from keras.preprocessing import sequence

with

from keras.utils import pad_sequences

Cheers,
Teslim.
image

@liukkcggvb
Copy link

Yes, the py.test failed because of this issue. It is noteworthy to mention that the attribute has been moved to keras.utils in keras 2.9....In your deep_learning4e.py file, replace

from keras.preprocessing import sequence

with

from keras.utils import pad_sequences

Cheers, Teslim. image

Your answer helped me, to add, let's remove "sequences." from all sequence.pad_sequences in the file.

@talessl
Copy link

talessl commented Jun 16, 2023

thank u so much for help me, both of u!

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