如何将现有模型张量加载到估计器中

时间:2020-07-01 14:24:09

标签: tensorflow

我有一个人提供的现有模型,可以打印该模型的张量,如下所示:

model_dir = estimator.model_dir

  checkpoint_path = os.path.join(model_dir, "model.ckpt-" + str(FLAGS.num_train_steps))

  print_tensors_in_checkpoint_file(file_name=checkpoint_path, all_tensors=True, tensor_name='')

我想使用将此模型加载到tf2估算器并使用estimator.predict()函数。但是我只看到一些示例,在这些示例中,我们使用估算器进行训练,然后进行预测。如果我们必须加载外部模型,则不需要。

0 个答案:

没有答案
相关问题