从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
![](https://i-blog.csdnimg.cn/blog_migrate/5e5e4ef134b6c5ec41c90d8076ee5f98.png)
打印变量
w = reader.get_tensor("fc1/W")
print type(w)
print w.shape
print w[0]
![](https://i-blog.csdnimg.cn/blog_migrate/127ce2618d1efe471a926732f1aea240.png)