https://www.jb51.net/article/177479.htm
https://blog.csdn.net/weixin_44058333/article/details/92691656
params = list(net.named_parameters()) # get the index by debuging
for i in range(len(params)):
print(i,params[i][1].data.sum(),params[i][0]) # data
打印文件:
params = list(net.named_parameters()) # get the index by debuging
param_str="\n"
for i in range(len(params)):
param_str += ( params[i][0] + ";") # data
with open("param_file.txt", 'a+') as f_write:
f_write.write(param_str)
param_str = "\n"
for i in range(len(params)):
param_str+=(str(float(params[i][1].data.sum()))+";") # data</