按语句

from keras.utils import to_categorical

导入categorical时报错,如下:
ImportError: cannot import name ‘to_categorical’ from ‘keras.utils’

将导入代码改为如下即可:

from tensorflow.keras.utils import to_categorical
Logo

有“AI”的1024 = 2048,欢迎大家加入2048 AI社区

更多推荐