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

Error in pipeline unittest after setup #316

Open
mbehrooz opened this issue Feb 22, 2018 · 13 comments
Open

Error in pipeline unittest after setup #316

mbehrooz opened this issue Feb 22, 2018 · 13 comments

Comments

@mbehrooz
Copy link

mbehrooz commented Feb 22, 2018

I initially encountered Bernoulli and Categorical import errors. I fixed that by doing the solutions in #285. But now I get a new error: (I have tf 1.5.0 rc-1)

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


Traceback (most recent call last):
File "/home/morteza/seq2seq/seq2seq/seq2seq/test/pipeline_test.py", line 76, in test_train_infer
_clear_flags()
File "/home/morteza/seq2seq/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'

@Shimin-Zhang
Copy link

Shimin-Zhang commented Mar 7, 2018

Incase you are still stuck, took me a bit but this finally worked:


# tf.app.flags.FLAGS = tf.app.flags._FlagValues()
attr_names = []
for i in tf.app.flags.FLAGS:
    names.append(i)
for n in attr_names:
    delattr(tf.app.flags.FLAGS, n)

@ivokwee
Copy link

ivokwee commented Apr 18, 2018

probably this was a mistake?

    attr_names.append(i)

@cameronrhamilton
Copy link

I am also facing this same error while using Tensorflow 1.7. @Johnszhang 's suggestion eliminated the initial error, but now I'm encountering a DuplicateFlagError, which suggests the flags are not actually getting cleared. Any suggestions?

@slvher
Copy link

slvher commented Apr 24, 2018

tf.app.flags.FLAGS is defined in (take the codebase of tf v1.5 as example):
https://github.com/tensorflow/tensorflow/blob/r1.5/tensorflow/python/platform/flags.py

It's a wrapper for FlagValues which defined in:
https://github.com/abseil/abseil-py/blob/master/absl/flags/_flagvalues.py

After reading the source code, i modified the function body of _clear_flags and the error gone away.
The hacking snippet looks like this:

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()

@cameronrhamilton Hope can help you :)

@cameronrhamilton
Copy link

Thank you @slvher ! I am unfortunately still receiving the following error:
DuplicateFlagError: The flag 'model_params' is defined twice. First from seq2seq.test.train_bin, Second from seq2seq.test.infer_bin. Description from first occurrence: YAML configuration string for the model parameters.
I am investigating to determine how to fix this, but have not made much progress.

@onlyjackfrost
Copy link

onlyjackfrost commented Jun 9, 2018

I got a problem after i solved the #285 and the AttributeError which @mbehrooz mentioned above
I used the command python -m unittest seq2seq.test.pipeline_test and i got a error below

PermissionError: [Errno 13] Permission denied: 'C:\\Users\\user\\AppData\\Local\\Temp\\tmpi7s9txub'
       
 [[Node: bleu/value = PyFunc[Tin=[DT_STRING, DT_STRING], Tout=[DT_FLOAT], token="pyfunc_0",
_device="/job:localhost/replica:0/task:0/device:CPU:0"](bleu/sources/read, bleu/targets/read)]]

I've check the path"C:\Users\user\AppData\Local\Temp" and there is no such file...
Btw im using Anaconda for python3.6 and tensorflow1.8 on window8.1

@neerajks
Copy link

Hi any luck resolving the above error ? I am facing the same error on tensorflow 1.8.

@nciefeiniu
Copy link

nciefeiniu commented Jun 26, 2018

@neerajks I have the same problem,

tensorflow and python version:
1.8.0 v1.8.0-0-g93bc2e2072 /usr/local/lib/python3.5/dist-packages/tensorflow/init.py

OS: ubuntu 16.04

Now ,The problem has been solved
thanks @slvher

@awonderfullife
Copy link

I think I have sloved all these error (ImportError, _FlagValues error and _tkinter.TclError) :
You could referenced this link:
https://blog.csdn.net/cow66/article/details/80815394
@neerajks @nciefeiniu

@misswang1221
Copy link

I got a problem after i solved the #285 and the AttributeError which @mbehrooz mentioned above
I used the command python -m unittest seq2seq.test.pipeline_test and i got a error below

PermissionError: [Errno 13] Permission denied: 'C:\\Users\\user\\AppData\\Local\\Temp\\tmpi7s9txub'
       
 [[Node: bleu/value = PyFunc[Tin=[DT_STRING, DT_STRING], Tout=[DT_FLOAT], token="pyfunc_0",
_device="/job:localhost/replica:0/task:0/device:CPU:0"](bleu/sources/read, bleu/targets/read)]]

I've check the path"C:\Users\user\AppData\Local\Temp" and there is no such file...
Btw im using Anaconda for python3.6 and tensorflow1.8 on window8.1

I got a problem after i solved the #285 and the AttributeError which @mbehrooz mentioned above
I used the command python -m unittest seq2seq.test.pipeline_test and i got a error below

PermissionError: [Errno 13] Permission denied: 'C:\\Users\\user\\AppData\\Local\\Temp\\tmpi7s9txub'
       
 [[Node: bleu/value = PyFunc[Tin=[DT_STRING, DT_STRING], Tout=[DT_FLOAT], token="pyfunc_0",
_device="/job:localhost/replica:0/task:0/device:CPU:0"](bleu/sources/read, bleu/targets/read)]]

I've check the path"C:\Users\user\AppData\Local\Temp" and there is no such file...
Btw im using Anaconda for python3.6 and tensorflow1.8 on window8.1

I got a same error. [PermissionError: [Errno 13] Permission denied: 'C:\Users\Administrator\AppData\Local\Temp\tmpzvxkn3wu']

@Mehty
Copy link

Mehty commented Feb 5, 2019

@neerajks I have the same problem,

tensorflow and python version:
1.8.0 v1.8.0-0-g93bc2e2072 /usr/local/lib/python3.5/dist-packages/tensorflow/init.py

OS: ubuntu 16.04

Now ,The problem has been solved
thanks @slvher

Any suggestions on how to fix this problem? I am working on windows 10, and I tried with the specified tf+python version above and still get the same error. I appreciate any help

@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

@sehargul-123
Copy link

please help me in this above issue I have been using tensorflow-gpu 1.14

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