I'm using tensorflow 2.4.0 and keras to plot Loss
vs epochs
history for the test and training set. I was able to do it when I was using tensorflow 1.1.5, using the code below; however, when trying to shift it to the new version, it doesn't work
model.fit(X2_train ,y2_train, epochs =100, batch_size = 32)
plt.subplot(1,1,1)
plt.plot(model.history.history['loss'])
plt.plot(model.history.history['val_loss'])
plt.title('Loss function of CNN Model')
plt.ylabel('loss')
plt.xlabel('epoch')
plt.legend(['train', 'test'], loc='upper right')
plt.ylim(0,200)
plt.grid()
plt.tight_layout()
plt.subplots_adjust(left=0.0, bottom=0.0, right=2.0, top=0.8, wspace=0.2, hspace=0.2)
plt.show()