Error:
AttributeError: module 'keras.preprocessing.sequence' has no attribute 'pad_sequences'
After reading many blogs, it is said that it is a version problem, and my version is 2.11.0
Solution
Some people said:
Change
from keras.preprocessing import sequence
to
from keras_preprocessing import sequence,
and the result is an error report (then I couldn’t find a solution to the relevant blog, maybe I’m too bad)
Some people said:
Change
from keras.preprocessing .sequence import pad_sequences
changed to
from keras_preprocessing.sequence import pad_sequences
or
from keras.utils import pad_sequences
Seeing the first modification, I wondered if it was the same as the previous method~
The result: As I expected, the same error
Then I tried the second modification, the result is as follows:
Hey~, success Hahaha,