问题描述
这是我的代码:我收到“关键错误”
def summary_diagnostics(histories):
for i in range(len(histories)):
# plot loss
pyplot.subplot(211)
pyplot.title('Cross Entropy Loss')
pyplot.plot(histories[i].history['loss'],color='blue',label='train')
pyplot.plot(histories[i].history['val_loss'],color='orange',label='test')
# plot accuracy
pyplot.subplot(212)
pyplot.title('Classification Accuracy')
pyplot.plot(histories[i].history['acc'],label='train')
pyplot.plot(histories[i].history['val_acc'],label='test')
pyplot.show()
总结模型性能
def summary_performance(得分):
# print summary
print('Accuracy: mean=%.3f std=%.3f,n=%d' % (mean(scores)*100,std(scores)*100,len(scores)))
# box and whisker plots of results
pyplot.boxplot(scores)
pyplot.show()
运行测试工具以评估模型
def run_test_harness():
# load dataset
trainX,trainY,testX,testY = load_dataset()
# prepare pixel data
trainX,testX = prep_pixels(trainX,testX)
# define model
model = define_model()
# evaluate model
scores,histories = evaluate_model(model,trainX,trainY)
# learning curves
summarize_diagnostics(histories)
# summarize estimated performance
summarize_performance(scores)
进入点,运行测试工具
run_test_harness()
KeyError:'acc'
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)