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

ml_collections / absl -- cannot read config updates from --flagfile #20

Open
danielkelshaw opened this issue Dec 21, 2022 · 0 comments
Open
Labels
bug Something isn't working

Comments

@danielkelshaw
Copy link

Describe the bug
When using config_flags.DEFINE_config_dict we are unable to use --flagfile to override values, we get the error:

FATAL Flags parsing error: Unknown command line flag ...

To Reproduce

# test.py

from absl import app, flags
from ml_collections import config_dict, config_flags

import copy


CONFIG = config_dict.ConfigDict(
    {
        'animal': {
            'cat': 10,
            'dog': 20
        },
        'vehicle': {
            'car': 30,
            'train': 40
        }
    }
)


FLAGS = flags.FLAGS
# _CONFIG = config_flags.DEFINE_config_dict('config', copy.deepcopy(CONFIG))
_CONFIG = config_flags.DEFINE_config_dict('config', CONFIG)


def main(_):

    print(FLAGS.config)


if __name__ == '__main__':
    app.run(main)
# flagfile.txt
--config.animal.cat=5000
$ python test.py --flagfile=flagfile.txt

FATAL Flags parsing error: Unknown command line flag 'config.animal.cat'
Pass --helpshort or --helpfull to see help on flags.

Expected behavior
absl should be able to read the changes to config from the flagfile.txt, something is going wrong here.

Environment:

  • OS: MacOS
  • OS Version: macOS Venture (13.0)
  • Python: 3.10.0
@danielkelshaw danielkelshaw added the bug Something isn't working label Dec 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant