I was trying to plot train and test learning curve in keras, however, the following code produces KeyError: \'val_acc error
.
The official document
I have changed acc to accuracy and my problem solved. Tensorflow 2+
e.g.
accuracy = history_dict['accuracy']
val_accuracy = history_dict['val_acccuracy']
to get any val_* data (val_acc
, val_loss
, ...), you need to first set the validation.
first method (will validate from what you give it):
model.fit(validation_data=(X_test, Y_test))
second method (will validate from a part of the training data):
model.fit(validation_split=0.5)