[关闭]
@devilloser 2017-08-01T10:01:55.000000Z 字数 292 阅读 767

收获1

tensorflow


1

读取checkpoint
tf.train.NewCheckpointReader('./ckpt')
cp.get_variable_to_shape_map()
获取变量列表
cp.get_tensor('...')
根据变量名读取变量值

2

finetune:
model_var=tf.get_collection(tf.GraphKeys.MODEL_VARIABLES)
saver=tf.train.Saver(var_list=model_var)
saver.restore(sess,ckpt_path)
如果不想要某一层参数,可以在model_var中去掉

添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注