tensor2tensor
tensor2tensor copied to clipboard
transformer_base never registered with registry hparams
Description
I run a trained model to translate some text. But I meet an error (bottom).
hparams = trainer_lib.create_hparams(hparams_set, data_dir=data_dir,
problem_name=problem_name)
translate_model = registry.model(model_name)(hparams, Modes.EVAL)
ckpt_path = tf.train.latest_checkpoint(os.path.join(checkpoint_dir, "t2t_export"))
inputs = "The animal is duck"
outputs = translate(ckpt_path, translate_model, inputs)
print("Inputs: %s" % inputs)
print("Outputs: %s" % outputs)
...
Environment information
OS: Ubuntu 16.04
$ pip freeze | grep tensor
mesh-tensorflow==0.1.5
tensor2tensor==1.15.2
tensorboard==1.15.0
tensorflow==1.15.0
tensorflow-datasets==1.3.0
tensorflow-estimator==1.15.1
tensorflow-estimator-2.0-preview==2.0.0
tensorflow-gan==2.0.0
tensorflow-hub==0.7.0
tensorflow-metadata==0.15.1
tensorflow-probability==0.7.0
$ python -V
# Python 3.6.8
Error logs:
hparams = trainer_lib.create_hparams(hparams_set, data_dir=data_dir, problem_name=problem_name) File "/home/env_tensor/lib/python3.6/site-packages/tensor2tensor/utils/hparams_lib.py", line 48, in create_hparams hparams = registry.hparams(hparams_set) File "/home/env_tensor/lib/python3.6/site-packages/tensor2tensor/utils/registry.py", line 254, in getitem (key, self.name, display_list_by_prefix(sorted(self), 4))) KeyError: 'transformer_base never registered with registry hparams. Available:\n basic:\n * basic_1'
I have the same problem. Have you solved it
Hi Not yet I used another solution
On Tue, Jul 21, 2020 at 16:18 teanon [email protected] wrote:
I have the same problem. Have you solved it
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/tensorflow/tensor2tensor/issues/1762#issuecomment-661740380, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACEA7IH3UI53UUNNLIFA2TTR4VMP3ANCNFSM4JTXL4MQ .
--
Thank you and Best Regards,
LÊ NGỌC THẠCH
Network Operations Center Monitor Mobile: 0167 423 0 465 Mail: [email protected] [email protected] Skype: ngocthach1207
try to "import tensor2tensor.models" in advance