Skip to content
This repository has been archived by the owner on Jul 7, 2023. It is now read-only.

how to decode with tensorflow 2.x? #1865

Open
fancyerii opened this issue Oct 31, 2020 · 0 comments
Open

how to decode with tensorflow 2.x? #1865

fancyerii opened this issue Oct 31, 2020 · 0 comments

Comments

@fancyerii
Copy link

I have follow this notebook(https://github.com/tensorflow/tensor2tensor/blob/master/tensor2tensor/notebooks/Transformer_translate.ipynb) to do translation task. But I am using tensorflow 2.3. I can't find any alternatives for restore_variables_on_create

def translate(inputs):
  encoded_inputs = encode(inputs)
  with tfe.restore_variables_on_create(ckpt_path):
    model_output = translate_model.infer(encoded_inputs)["outputs"]
  return decode(model_output)

How should I load model from checkpoint?

The full codes for train can be found here; test codes here

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant