keras中module ‘keras.utils‘ has no attribute ‘to_categorical‘解决方案
项目场景:在运行环境为:python 3.9.7,tensorflow 2.6.0,keras 2.6.0模型训练中报错问题描述当代码编辑如下时,运行中总会报出module 'keras.utils' has no attribute 'to_categorical'的错误y_train = keras.utils.to_categorical(y_train, 10)y_test = keras.utils.to_categorical(y_test, 10)原因分析:.
原创
2022-04-05 20:20:45 ·
4938 阅读 ·
3 评论