logo
Loading...

MLP show_train_history函式出現錯誤 - Cupoy

你好:執行 Day70 之SAMPLE CODE : Day70-Keras_Mnist_MLP_S...

ml100-3,ml100-3-d70

MLP show_train_history函式出現錯誤

2019/11/24 03:32 PM
機器學習新手論壇
葉庭瑜
觀看數:0
回答數:2
收藏數:0
ml100-3
ml100-3-d70

你好:


執行 Day70 之SAMPLE CODE : Day70-Keras_Mnist_MLP_Sample.ipynb ,在show_train_history(train_history,'acc','val_acc') 發生錯誤


在執行到 

show_train_history(train_history,'acc','val_acc') 

時出現以下錯誤訊息,不知是什麼原因。



--------------------------------------------------------------------------- KeyError                                  Traceback (most recent call last) <ipython-input-41-3de85ac01f91> in <module>       1 #show_train_history(train_history,'acc','val_acc') ----> 2 show_train_history(train_history,'acc','val_acc') <ipython-input-40-7c9f4f7020bd> in show_train_history(train_history, train, validation)       1 import matplotlib.pyplot as plt       2 def show_train_history(train_history,train,validation): ----> 3 plt.plot(train_history.history[train])       4     plt.plot(train_history.history[validation])       5     plt.title('Train History') KeyError: 'acc'