绘制loss曲线图

参考:https://hulin.blog.csdn.net/article/details/115979612?spm=1001.2101.3001.6650.1&utm_medium=distribute.pc_relevant.none-task-blog-2%7Edefault%7ECTRLIST%7ERate-1-115979612-blog-124158612.pc_relevant_paycolumn_v3&depth_1-utm_source=distribute.pc_relevant.none-task-blog-2%7Edefault%7ECTRLIST%7ERate-1-115979612-blog-124158612.pc_relevant_paycolumn_v3&utm_relevant_index=2

# 100 0.0146
# 200 0.0123

import matplotlib.pyplot as plt
import numpy as np

loss=np.loadtxt('iter+loss.txt')#log文件
#log日志文件来源于上一篇博客https://blog.csdn.net/qq_38335768/article/details/125273151
#第一列iter,第二列loss
x=loss[:,0]
y=loss[:,1]

fig=plt.figure(figsize=(7,5))
plt.plot(x,y,'r-',label=u'basicvsr++loss')#label表示曲线名称,r表示红色
plt.legend()

plt.xlabel(u'iters')
plt.ylabel(u'loss')

plt.title(' loss for basicvsr++ model in training.')
plt.show()
#https://hulin.blog.csdn.net/article/details/115979612?spm=1001.2101.3001.6650.1&utm_medium=distribute.pc_relevant.none-task-blog-2%7Edefault%7ECTRLIST%7ERate-1-115979612-blog-124158612.pc_relevant_paycolumn_v3&depth_1-utm_source=distribute.pc_relevant.none-task-blog-2%7Edefault%7ECTRLIST%7ERate-1-115979612-blog-124158612.pc_relevant_paycolumn_v3&utm_relevant_index=2

你可能感兴趣的:(tips,python,开发语言)