keras-preprocessing icon indicating copy to clipboard operation
keras-preprocessing copied to clipboard

module 'keras preprocessing.text' has no attribute 'tokenizer from_json'

Open lijinfeng0713 opened this issue 5 years ago • 3 comments

when I use python3.5, keras 2.2.4 and keras_preprocessing1.0.8, there is a error,

AttributeError: module 'keras preprocessing.text' has no attribute 'tokenizer from_json'

who can help me? Thanks

lijinfeng0713 avatar Jul 09 '19 01:07 lijinfeng0713

I am having the same issue, in the meantime you can just take the code from here: https://github.com/keras-team/keras-preprocessing/blob/master/keras_preprocessing/text.py#L488

r3ndd avatar Jul 21 '19 01:07 r3ndd

How did you write the code? sometimes it can just be a simple syntax error.

chinyemba avatar Jul 19 '20 08:07 chinyemba

I think the word 'tokenizer' should be expressed with capital 'T' as "Tokenizer".

Example:

tokenizer = keras.preprocessing.text.Tokenizer(char_level = True)

chinyemba avatar Jul 19 '20 08:07 chinyemba