错误:Graph execution error: Detected at node 'sparse_categorical_crossentropy/SparseSoftmaxCrossEntropyWithLogits/SparseSoftmaxCrossEntropyWithLogits' defined at (most recent call last):
实际上是损失函数的问题、
model.compile(optimizer= opt, loss= 'sparse_categorical_crossentropy', metrics=['accuracy']) # adam优化器,loss function,训练过程中计算准确率
解决错误方法:将loss= 'sparse_categorical_crossentropy'改为'categorical_crossentropy'
model.compile(optimizer= opt, loss= 'categorical_crossentropy', metrics=['accuracy'])