tensorflow 根据节点名称获取节点

ckpt_file = os.path.join(self.args.bert_dir, 'model.ckpt-6123')

# 获取图的reader
reader = self.tf_instance.train.NewCheckpointReader(ckpt_file)
# 根据节点名称获取节点
output_weights = reader.get_tensor('output_weights')
output_bias = reader.get_tensor('output_bias')

 

posted @ 2019-02-16 17:19  下路派出所  阅读(2121)  评论(0编辑  收藏  举报