Skip to content
This repository was archived by the owner on Jul 7, 2023. It is now read-only.
This repository was archived by the owner on Jul 7, 2023. It is now read-only.

AttributeError: module 'tensorflow' has no attribute 'flags' #1754

Open
@birdmw

Description

@birdmw

Description

C:\Users\XXXXX\Anaconda3\Lib\site-packages\tensor2tensor\bin>python t2t_trainer.py

Traceback (most recent call last):
  File "t2t_trainer.py", line 24, in <module>
    from tensor2tensor import models  # pylint: disable=unused-import
  File "C:\Users\XXXXX\Anaconda3\lib\site-packages\tensor2tensor\models\__init__.py", line 26, in <module>
    from tensor2tensor.models import basic
  File "C:\Users\XXXXX\Anaconda3\lib\site-packages\tensor2tensor\models\basic.py", line 25, in <module>
    from tensor2tensor.utils import t2t_model
  File "C:\Users\XXXXX\Anaconda3\lib\site-packages\tensor2tensor\utils\t2t_model.py", line 37, in <module>
    from tensor2tensor.utils import decoding
  File "C:\Users\XXXXX\Anaconda3\lib\site-packages\tensor2tensor\utils\decoding.py", line 41, in <module>
    FLAGS = tf.flags.FLAGS
AttributeError: module 'tensorflow' has no attribute 'flags'

Environment information

OS: Windows 10 - 64bit

$ pip freeze | grep tensor
tensor2tensor==1.15.2
tensorboard==2.0.1
tensorflow==2.0.0
tensorflow-datasets==1.3.0
tensorflow-estimator==2.0.1
tensorflow-gan==2.0.0
tensorflow-gpu==2.0.0
tensorflow-hub==0.7.0
tensorflow-metadata==0.15.1
tensorflow-probability==0.7.0
tf-estimator-nightly==2.0.0.dev2019111709
tf-nightly-gpu==2.1.0.dev20191117

$ python -V

Python 3.7.4

$ conda info

     active environment : None
       user config file : C:\Users\XXXX\.condarc
 populated config files :
          conda version : 4.7.12
    conda-build version : 3.18.9
         python version : 3.7.4.final.0
       virtual packages : __cuda=10.2
       base environment : C:\Users\XXXX\Anaconda3  (writable)
           channel URLs : https://repo.anaconda.com/pkgs/main/win-64
                          https://repo.anaconda.com/pkgs/main/noarch
                          https://repo.anaconda.com/pkgs/r/win-64
                          https://repo.anaconda.com/pkgs/r/noarch
                          https://repo.anaconda.com/pkgs/msys2/win-64
                          https://repo.anaconda.com/pkgs/msys2/noarch
          package cache : C:\Users\XXXX\Anaconda3\pkgs
                          C:\Users\XXXX\.conda\pkgs
                          C:\Users\XXXX\AppData\Local\conda\conda\pkgs
       envs directories : C:\Users\XXXX\Anaconda3\envs
                          C:\Users\XXXX\.conda\envs
                          C:\Users\XXXX\AppData\Local\conda\conda\envs
               platform : win-64
             user-agent : conda/4.7.12 requests/2.22.0 CPython/3.7.4 Windows/10 Windows/10.0.17134
          administrator : False
             netrc file : None
           offline mode : False

Steps to reproduce:

With tensorflow-gpu-nightly installed on a win10 64 bit - simply navigate to
\Anaconda3\Lib\site-packages\tensor2tensor\bin
and type
python t2t_{{any_file}}.py

Error logs:

  File "C:\Users\XXXX\Anaconda3\lib\site-packages\tensor2tensor\utils\decoding.py", line 41, in <module>
    FLAGS = tf.flags.FLAGS
AttributeError: module 'tensorflow' has no attribute 'flags'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions