aaa = tnn_bin_weight.data.cpu().numpy().reshape(-1, 1)
np.savetxt('result55.txt', aaa)
torch.save(tnn_bin_weight, 'test44.pt') # 保存
查看权重以及BN层的参数
print(m)
for name, p in m.named_parameters():
print(name, ' :', p.shape)
for name, p in m.named_parameters():
print(name, ' :', p.data)
查看网络模型的激活平均值,方差等参数
print(m.state_dict())