主要是版本问题,新版的keras里没有这个库,将原来的代码改一下就行
改前:from keras.utils import to_categorical
运行后就出错了
改后:from tensorflow.keras.utils import to_categorical
这样就能正常运行了
主要是版本问题,新版的keras里没有这个库,将原来的代码改一下就行
改前:from keras.utils import to_categorical
运行后就出错了
改后:from tensorflow.keras.utils import to_categorical
这样就能正常运行了