python keras.preprocessing.sequence has no attribute pad_sequences
Seems like your keras version is greater than 2.8 that's why getting error as
from keras.preprocessing import sequence
works for earlier version. Instead, replace with the below given code:
from keras.utils.data_utils import pad_sequences
You can also use:
from tensorflow.keras.preprocessing.sequence import pad_sequences
They both worked for me.
import:from keras.preprocessing import sequence
but:
AttributeError: module 'keras.preprocessing.sequence' has no attribute 'pad_sequences'
Why?
How can I edit this?