tensor2tensor icon indicating copy to clipboard operation
tensor2tensor copied to clipboard

My customed problem never registered with registry problems

Open EnigmaZhang opened this issue 5 years ago • 1 comments

Description

I am following a tutorial of microsoft from this website https://github.com/microsoft/ai-edu/tree/master/B-%E5%AE%9E%E8%B7%B5%E6%A1%88%E4%BE%8B/B13-AI%E5%AF%B9%E8%81%94%E7%94%9F%E6%88%90%E6%A1%88%E4%BE%8B#%E6%A8%A1%E5%9E%8B%E6%8E%A8%E7%90%86 to get a model to inference Chinese couplet. Now I have trained the model on Google cloud and I can also get good inference. Howerver, when I am constructing inference service, I found my function to communicate with tensorflowserverapi can't find my problem get registered. I also have trained this model for one step and add t2t_trainer --registry_help, and I can see my problem is actually registered under problems Problems.

My code is just the same as https://github.com/microsoft/ai-edu/blob/master/B-%E5%AE%9E%E8%B7%B5%E6%A1%88%E4%BE%8B/B13-AI%E5%AF%B9%E8%81%94%E7%94%9F%E6%88%90%E6%A1%88%E4%BE%8B/code/service/up2down_model/up2down_model.py

And here is my test code:

from up2down_model.up2down_model import up2down
upper_couplet = input()
up2down.get_down_couplet([upper_couplet])

Thanks for your reading and time.

Environment information

OS: Ubuntu 20.04

$ pip freeze | grep tensor
tensor2tensor            1.15.6             
tensorboard              1.14.0             
tensorflow               1.14.0             
tensorflow-addons        0.10.0             
tensorflow-datasets      1.3.0              
tensorflow-estimator     1.14.0             
tensorflow-gan           2.0.0              
tensorflow-hub           0.8.0              
tensorflow-metadata      0.22.0             
tensorflow-probability   0.7.0              
tensorflow-serving-api   1.14.0 

$ python -3.7.7

For bugs: reproduction and error logs

Error logs:

raceback (most recent call last):
  File "/home/enigma/anaconda3/envs/NLP/lib/python3.7/site-packages/tensor2tensor/utils/registry.py", line 509, in problem
    return Registries.problems[spec.base_name](
  File "/home/enigma/anaconda3/envs/NLP/lib/python3.7/site-packages/tensor2tensor/utils/registry.py", line 254, in __getitem__
    (key, self.name, display_list_by_prefix(sorted(self), 4)))
KeyError: 'translate_up2down never registered with registry problems. Available:
All problems without my own

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "test.py", line 1, in <module>
    from up2down_model.up2down_model import up2down
  File "/home/enigma/Desktop/NLP/service/up2down_model/up2down_model.py", line 85, in <module>
    up2down = up2down_class(FLAGS,server_address) # inference model
  File "/home/enigma/Desktop/NLP/service/up2down_model/up2down_model.py", line 40, in __init__
    self.problem = registry.problem(self.FLAGS.problem)
  File "/home/enigma/anaconda3/envs/NLP/lib/python3.7/site-packages/tensor2tensor/utils/registry.py", line 513, in problem
    return env_problem(problem_name, **kwargs)
  File "/home/enigma/anaconda3/envs/NLP/lib/python3.7/site-packages/tensor2tensor/utils/registry.py", line 527, in env_problem
    ep_cls = Registries.env_problems[env_problem_name]
  File "/home/enigma/anaconda3/envs/NLP/lib/python3.7/site-packages/tensor2tensor/utils/registry.py", line 254, in __getitem__
    (key, self.name, display_list_by_prefix(sorted(self), 4)))
KeyError: 'translate_up2down never registered with registry env_problems. Available:\n     reacher:\n      * reacher_env_problem\n    tic:\n      * tic_tac_toe_env_problem'

EnigmaZhang avatar Jun 12 '20 13:06 EnigmaZhang

Have you solved this?

Tinarights avatar Jan 22 '22 09:01 Tinarights