AttributeError: Module 'keras.utils' Has No Attribute 'to Categorical'

[Solved] AttributeError: Module 'keras.utils' Has No Attribute 'to Categorical' | Python - Code Explorer | yomemimo.com
Question : AttributeError: module 'keras.utils' has no attribute 'to_categorical'

Answered by : mahjoubi-redwane

Newer versions of keras==2.4.0 and tensorflow==2.3.0 would work as follows.
Import:
from keras.utils import np_utils
or
from keras import utils as np_utils
and then replace keras.utils.to_categorical with
keras.utils.np_utils.to_categorical

Source : | Last Update : Fri, 04 Feb 22

Question : AttributeError: module 'keras.utils' has no attribute 'to_categorical'

Answered by : mahjoubi-redwane

AttributeError: 'Sequential' object has no attribute 'predict_classes'

Source : | Last Update : Fri, 04 Feb 22

Answers related to AttributeError: module 'keras.utils' has no attribute 'to categorical'

Code Explorer Popular Question For Python