Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

raise _exceptions.DuplicateFlagError.from_flag #38

Open
nithrous opened this issue Aug 31, 2019 · 1 comment
Open

raise _exceptions.DuplicateFlagError.from_flag #38

nithrous opened this issue Aug 31, 2019 · 1 comment

Comments

@nithrous
Copy link

Hi, I try to train but using this cmd command:

main.py --train_dir=../imgs/train/ --val_dir=../imgs/val/ --image_height=60 --image_width=180 --image_channel=1 --out_channels=64 --num_hidden=128 --batch_size=128 --log_dir=./log/train --num_gpus=1 -mode=train

But got this error:

Traceback (most recent call last):
  File "C:\Projects\CNN_LSTM_CTC_Tensorflow\main.py", line 14, in <module>
    import cnn_lstm_otc_ocr
  File "C:\Projects\CNN_LSTM_CTC_Tensorflow\cnn_lstm_otc_ocr.py", line 6, in <module>
    import utils
  File "C:\Projects\CNN_LSTM_CTC_Tensorflow\utils.py", line 43, in <module>
    tf.app.flags.DEFINE_string('log_dir', './log', 'the logging dir')
  File "C:\Users\N1throServer\AppData\Local\Programs\Python\Python37\lib\site-packages\tensorflow\python\platform\flags.py", line 58, in wrapper
    return original_function(*args, **kwargs)
  File "C:\Users\N1throServer\AppData\Local\Programs\Python\Python37\lib\site-packages\absl\flags\_defines.py", line 241, in DEFINE_string
    DEFINE(parser, name, default, help, flag_values, serializer, **args)
  File "C:\Users\N1throServer\AppData\Local\Programs\Python\Python37\lib\site-packages\absl\flags\_defines.py", line 82, in DEFINE
    flag_values, module_name)
  File "C:\Users\N1throServer\AppData\Local\Programs\Python\Python37\lib\site-packages\absl\flags\_defines.py", line 104, in DEFINE_flag
    fv[flag.name] = flag
  File "C:\Users\N1throServer\AppData\Local\Programs\Python\Python37\lib\site-packages\absl\flags\_flagvalues.py", line 430, in __setitem__
    raise _exceptions.DuplicateFlagError.from_flag(name, self)
absl.flags._exceptions.DuplicateFlagError: The flag 'log_dir' is defined twice. First from absl.logging, Second from utils.  Description from first occurrence: directory to write logfiles into

How can it be fixed?

@xywzhht
Copy link

xywzhht commented Nov 18, 2019

I have encountered the same mistake. Has anyone solved the problem now

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

No branches or pull requests

2 participants