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

Incompatibility with TF2.0 #1524

Closed shkarupa-alex closed 5 years ago

shkarupa-alex commented 5 years ago

Description

Got an error when running t2t-trainer --registry_help with installed "tensorflow alpha"

Environment information

OS: MacOS X

$ pip freeze | grep tensor
mesh-tensorflow==0.0.5
tensor2tensor==1.13.1
tensorboard==1.12.0
tensorflow==2.0.0a0
tensorflow-datasets==1.0.1
tensorflow-fold==0.0.1
tensorflow-hub==0.1.1
tensorflow-metadata==0.13.0
tensorflow-serving-api==1.7.0
tensorflow-tensorboard==1.5.1
tensorflow-zero==0.0.4

$ python -V
Python 2.7.15

For bugs: reproduction and error logs

# Steps to reproduce:
pip install -U --pre tensorflow
pip install -U tensor2tensor
pip uninstall tensorflow-probability
pip install -U tfp-nightly
t2t-trainer --registry_help
# Error logs:
Traceback (most recent call last):
  File "/usr/local/bin/t2t-trainer", line 23, in <module>
    from tensor2tensor.bin import t2t_trainer
  File "/usr/local/lib/python2.7/site-packages/tensor2tensor/bin/t2t_trainer.py", line 25, in <module>
    from tensor2tensor import models  # pylint: disable=unused-import
  File "/usr/local/lib/python2.7/site-packages/tensor2tensor/models/__init__.py", line 25, in <module>
    from tensor2tensor.layers import modalities  # pylint: disable=g-import-not-at-top
  File "/usr/local/lib/python2.7/site-packages/tensor2tensor/layers/modalities.py", line 28, in <module>
    from tensor2tensor.layers import common_attention
  File "/usr/local/lib/python2.7/site-packages/tensor2tensor/layers/common_attention.py", line 5074, in <module>
    @expert_utils.add_var_scope()
  File "/usr/local/lib/python2.7/site-packages/tensor2tensor/utils/expert_utils.py", line 68, in add_var_scope
    return add_scope(scope, scope_fn=tf.variable_scope)
AttributeError: 'module' object has no attribute 'variable_scope'
afrozenator commented 5 years ago

Hi @shkarupa-alex -- We aren't compatible with TF 2.0 yet.

Please checkout https://github.com/tensorflow/tensor2tensor/issues/1478 as well.