Plotting learning curve in keras gives KeyError: 'val_acc'

前端 未结 8 2065
情话喂你
情话喂你 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:29

    You may need to enable the validation split of your trainset. Usually, the validation happens in 1/3 of the trainset. In your code, make the change as given below:

    history=model.fit(X[train], dummy_y[train],validation_split=0.33,nb_epoch=200, batch_size=5, verbose=0) 
    

    It works!

提交回复
热议问题