从tensorflow 训练后保存的模型中打印训变量:使用 tf.train.NewCheckpointReader() import tensorflow as tfreader = tf.train.NewCheckpointReader('path/alexnet/model-330000')dic = reader.get_variable_to_shape_map()print dic 打印
从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]
以上这篇从训练好的tensorflow模型中打印训练变量实例就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持易盾网络。