当前位置:主页 > 软件编程 > Python代码 >

从训练好的tensorflow模型中打印训练变量实例

时间:2021-04-14 09:06:27 | 栏目:Python代码 | 点击:

从tensorflow 训练后保存的模型中打印训变量:使用tf.train.NewCheckpointReader()

import tensorflow as tf
reader = tf.train.NewCheckpointReader('path/alexnet/model-330000')
dic = reader.get_variable_to_shape_map()
print dic

打印变量

w = reader.get_tensor("fc1/W")
print type(w)
print w.shape
print w[0]

您可能感兴趣的文章:

相关文章