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')