Open shriramsb opened 6 years ago
Have the same error while running the transformer on TPU and Librispeech problem.
Try to use tensor2tensor==1.7.0
The problem seems to stem from the definition of estimator_model_fn in t2t_model.py After t2t v1.7.0 they removed the explicitly passed "use_tpu" parameter and now try to get it from the "params" dictionary parameter. Only problem is I don't know where params is passed from. Does anyone know how to set params?
Is this fixed?
Tensor2tensor 1.7.0 works. 1.8.0 doesn't.
You mean Tensor2tensor 1.7.0 ? And will it work with Tensorflow 1.9?
If i intsall T2T 1.7 and in TPU tensorflow version is 1.8 or 1.9 == No TPU cores found. T2T >1.7 TPU tensorflow version 1.8 or 1.9 == doesnt work == AttributeError: 'RunConfig' object has no attribute 'data_parallelism'
@nicks165 I've gotten around this issue on T2T v1.9.0 by modifying t2t_model.py. On line 1248 in estimator_model_fn add: " if config.use_tpu: params = {'use_tpu':True}"
I'm not sure what the proper way to set the params dict is (this is not hparams, or hparams set, and there doesn't seem to be a flag to set params). It may be safer to modify params to default to an empty dict and instead on line 1248 to instead add: " if config.use_tpu: params['use_tpu']=True" to prevent completely overwriting params if it IS passed. (Haven't tested this, but it should work).
It still gives above error when params is passed in the dictionary. File "/usr/local/lib/python3.5/dist-packages/tensor2tensor/utils/t2t_model.py", line 1219, in estimator_model_fn data_parallelism = config.data_parallelism AttributeError: 'RunConfig' object has no attribute 'data_parallelism'
Description
Followed steps exactly as given in official tutorial for running Transformer on Cloud TPU - https://cloud.google.com/tpu/docs/tutorials/transformer except using PROBLEM=translate_enfr_wmt_small8k Got error: AttributeError: 'RunConfig' object has no attribute 'data_parallelism' when running step 3 of 'Train an English-German translation model' modified for my PROBLEM.
Environment information
For bugs: reproduction and error logs
Steps to reproduce:
This can be reproduced by following tutorial - https://cloud.google.com/tpu/docs/tutorials/transformer with PROBLEM=translate_enfr_wmt_small8k instead of 'translate_ende_wmt32k_packed'. Error will occur when running step 3 of 'Train an English-German translation model' modified for this problem.
Error logs: