用loss.txt画loss图
import matplotlib.pyplot as plt
def plot_loss(fileName):
print('Start to plot loss line')
allData = []
file = open(fileName, 'r')
fileData = file.readlines()
for row in fileData:
allData.append(float(row[:-1]))
plt.plot(allData)
plt.savefig('loss.png')
if __name__=='__main__':
print('Start to run plot')
plot_loss('1331.txt')
标签:__,loss,plt,plot,Start,cv,allData
From: https://www.cnblogs.com/starcos/p/16847984.html