seq2seq icon indicating copy to clipboard operation
seq2seq copied to clipboard

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

Open newmluser opened this issue 6 years ago • 4 comments

====================================================================== 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.

newmluser avatar Sep 13 '19 13:09 newmluser

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

sehargul-123 avatar Oct 28 '19 08:10 sehargul-123

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

WEIFZH avatar Nov 29 '19 08:11 WEIFZH

Any luck ??

zakmicallef avatar Jul 23 '21 18:07 zakmicallef

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

bentodaniel avatar Apr 27 '22 18:04 bentodaniel