Plotting learning curve in keras gives KeyError: 'val_acc'

前端 未结 8 2046
情话喂你
情话喂你 2020-12-09 09:54

I was trying to plot train and test learning curve in keras, however, the following code produces KeyError: \'val_acc error.

The official document

8条回答
  •  温柔的废话
    2020-12-09 10:43

    If you upgrade keras older version (e.g. 2.2.5) to 2.3.0 (or newer) which is compatible with Tensorflow 2.0, you might have such error (e.g. KeyError: 'acc'). Both acc and val_acc has been renamed to accuracy and val_accuracy respectively. Renaming them in script will solve the issue.

提交回复
热议问题