tensorflow / tensor2tensor

Library of deep learning models and datasets designed to make deep learning more accessible and accelerate ML research.
Apache License 2.0
15.5k stars 3.49k forks source link

ImportError: No module named 'mesh_tensorflow.transformer' #1449

Closed stefan-falk closed 5 years ago

stefan-falk commented 5 years ago

Description

Importing t2t_trainer is not working in 1.12.0.

I have just updated my t2t version to 1.12.0 and noticed that I cannot import t2t_trainer anymor as I am getting

ImportError: No module named 'mesh_tensorflow.transformer'

which was not the case in 1.11.0. ...

Reproduce

from tensor2tensor.bin import t2t_trainer

if __name__ == '__main__':
    t2t_trainer.main(None)

Stack trace

Traceback (most recent call last):
  File "/home/sfalk/tmp/pycharm_project_265/asr/punctuation/test.py", line 1, in <module>
    from tensor2tensor.bin import t2t_trainer
  File "/home/sfalk/miniconda3/envs/t2t/lib/python3.5/site-packages/tensor2tensor/bin/t2t_trainer.py", line 24, in <module>
    from tensor2tensor import models  # pylint: disable=unused-import
  File "/home/sfalk/miniconda3/envs/t2t/lib/python3.5/site-packages/tensor2tensor/models/__init__.py", line 35, in <module>
    from tensor2tensor.models import mtf_transformer2
  File "/home/sfalk/miniconda3/envs/t2t/lib/python3.5/site-packages/tensor2tensor/models/mtf_transformer2.py", line 23, in <module>
    from mesh_tensorflow.transformer import moe
ImportError: No module named 'mesh_tensorflow.transformer'

Environment information

OS: Linux 4.15.0-45-generic #48~16.04.1-Ubuntu SMP Tue Jan 29 18:03:48 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

$ pip freeze | grep tensor
mesh-tensorflow==0.0.4
tensor2tensor==1.12.0
tensorboard==1.12.0
tensorflow-gpu==1.12.0
tensorflow-metadata==0.9.0
tensorflow-probability==0.5.0

$ python -V
Python 3.5.6 :: Anaconda, Inc.
stefan-falk commented 5 years ago

Okay, turns out I just had to update mesh-tensorflow to version 0.0.5.