import matplotlib.pyplot as plt plt.plot(result.history['loss'],label='train loss') plt.plot(result.history['val_loss'],label='val loss') plt.legend() plt.show() plt.savefig('Loss_val loss') plt.plot(result.history['accuracy'],label='train acc') plt.plot(result.history['val_accuracy'],label='val acc') plt.legend() plt.savefig('accVal_acc')
You can use the following code to plot the loss and accuracy of your model. import matplotlib.pyplot as plt import tensorflow as tf import numpy as np # Load the MNIST dataset from tensorflow.examples.tutorials.mnist import input_data mnist = input_data.read_data_sets("MNIST_data/", one