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

code issue #11

Open
wangzeyu135798 opened this issue Feb 13, 2021 · 2 comments
Open

code issue #11

wangzeyu135798 opened this issue Feb 13, 2021 · 2 comments

Comments

@wangzeyu135798
Copy link

When I run train.py, there is a problem following:
absl.flags._exceptions.DuplicateFlagError: The flag 'log_dir' is defined twice. First from absl.logging, Second from flags. Description from first occurrence: directory to write logfiles into

@aravindsankar28
Copy link
Owner

The hyper-paramter settings are copied from parser to flags. It should work correctly if you execute run_script.py.

@fanfanman
Copy link

The issue happens for tf1.14 due to flags pre-initialized by "absl" package. Adding the following lines to flags.py to delete existed flags works for me, reference

def del_all_flags(FLAGS):
    flags_dict = FLAGS._flags()    
    keys_list = [keys for keys in flags_dict]    
    for keys in keys_list:
        FLAGS.__delattr__(keys)

del_all_flags(tf.flags.FLAGS)

(Add after ”FLAGS = flags.FLAGS“ in "flags.py")

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

3 participants