Skip to content
This repository has been archived by the owner on Dec 29, 2022. It is now read-only.

AttributeError: module 'tensorflow.python.platform.flags' has no attribute '_FlagValues' #360

Open
newmluser opened this issue Sep 13, 2019 · 4 comments

Comments

@newmluser
Copy link

======================================================================
ERROR: test_train_infer (seq2seq.test.pipeline_test.PipelineTest)
Tests training and inference scripts.

Traceback (most recent call last):
File "C:\Users\xxxxx\NLP\seq2seqten\seq2seq\seq2seq\test\pipeline_test.py", line 76, in test_train_infer
_clear_flags()
File "C:\Users\xxxxxx\NLP\seq2seqten\seq2seq\seq2seq\test\pipeline_test.py", line 44, in _clear_flags
tf.app.flags.FLAGS = tf.app.flags._FlagValues()
AttributeError: module 'tensorflow.python.platform.flags' has no attribute '_FlagValues'


Ran 2 tests in 0.733s

FAILED (errors=1, skipped=1)

Can you please help me how I can get solve this error.

@sehargul-123
Copy link

Traceback (most recent call last):
File "DeepSpeech.py", line 11, in
import absl.app
File "/home/sehar/venv/lib/python3.6/site-packages/absl/app.py", line 40, in
from absl import flags
File "/home/sehar/venv/lib/python3.6/site-packages/absl/flags/init.py", line 41, in
from absl.flags import _defines
File "/home/sehar/venv/lib/python3.6/site-packages/absl/flags/_defines.py", line 31, in
from absl.flags import _flagvalues
File "/home/sehar/venv/lib/python3.6/site-packages/absl/flags/_flagvalues.py", line 27, in
import logging
File "/home/sehar/DeepSpeech/logging.py", line 6, in
from util.flags import FLAGS
File "/home/sehar/DeepSpeech/util/flags.py", line 6, in
FLAGS = absl.flags.FLAGS
AttributeError: module 'absl' has no attribute 'flags'
kindly help me to slove this error

@WEIFZH
Copy link

WEIFZH commented Nov 29, 2019

I run into the same error,did you solve the problem?:D

@zakmicallef
Copy link

Any luck ??

@bentodaniel
Copy link

bentodaniel commented Apr 27, 2022

change the _clear_flags function in seq2seq\seq2seq\test\pipeline_test.py to

def _clear_flags():
  """Resets Tensorflow's FLAG values"""
  #pylint: disable=W0212
  for flag_key in dir(tf.app.flags.FLAGS):
    delattr(tf.app.flags.FLAGS, flag_key)
  #tf.app.flags.FLAGS = tf.app.flags._FlagValues()
  tf.app.flags._global_parser = argparse.ArgumentParser()

this has worked for me

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants