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

[Docs] Print full config not exists #1535

Closed
nuaalyh opened this issue Dec 14, 2022 · 2 comments · Fixed by #1590
Closed

[Docs] Print full config not exists #1535

nuaalyh opened this issue Dec 14, 2022 · 2 comments · Fixed by #1590
Assignees
Labels
good first issue info/1.x an issue or a pr for 1.x branch

Comments

@nuaalyh
Copy link

nuaalyh commented Dec 14, 2022

Branch

master branch https://mmediting.readthedocs.io/en/latest/

📚 The doc issue

Dir: tools missing file: misc/print_config.py,
but doc: https://mmediting.readthedocs.io/en/dev-1.x/user_guides/useful_tools.html still has content of 'Print full config'.

Suggest a potential alternative/fix

add relative code:

import argparse

from mmengine import Config, DictAction


def parse_args():
    parser = argparse.ArgumentParser(description='Print the whole config')
    parser.add_argument('config', help='config file path')
    parser.add_argument(
        '--cfg-options',
        nargs='+',
        action=DictAction,
        help='override some settings in the used config, the key-value pair '
        'in xxx=yyy format will be merged into config file. If the value to '
        'be overwritten is a list, it should be like key="[a,b]" or key=a,b '
        'It also allows nested list/tuple values, e.g. key="[(a,b),(c,d)]" '
        'Note that the quotation marks are necessary and that no white space '
        'is allowed.')
    args = parser.parse_args()

    return args


def main():
    args = parse_args()

    cfg = Config.fromfile(args.config)
    if args.cfg_options is not None:
        cfg.merge_from_dict(args.cfg_options)
    print(f'Config:\n{cfg.pretty_text}')


if __name__ == '__main__':
    main()
@nuaalyh nuaalyh added the kind/doc fix, add or improve documentations label Dec 14, 2022
@plyfager
Copy link
Collaborator

Hi, @nuaalyh . https://mmediting.readthedocs.io/en/dev-1.x/user_guides/useful_tools.html is the docs for branch dev-1.x. In master branch, we didn't seem to support print_config yet. If you'd like to support it, we'll appreciate it a lot.

And also welcome to our 1.x branch, which is a new version of our repo and supported many new models there.

@zengyh1900 zengyh1900 added the info/1.x an issue or a pr for 1.x branch label Dec 28, 2022
@Z-Fran
Copy link
Collaborator

Z-Fran commented Jan 3, 2023

Hi, @nuaalyh . We have supported print_config in MMGeneration, but haven't in MMEditing. Would you like to support it? You can reference https://github.com/open-mmlab/mmgeneration/blob/master/tools/misc/print_config.py or https://github.com/open-mmlab/mmgeneration/blob/dev-1.x/tools/misc/print_config.py. You can follow the Contributing guidance to open a pull request to branch master or branch dev-1.x

@Z-Fran Z-Fran self-assigned this Jan 3, 2023
@Z-Fran Z-Fran added good first issue and removed kind/doc fix, add or improve documentations labels Jan 4, 2023
@Z-Fran Z-Fran linked a pull request Jan 17, 2023 that will close this issue
7 tasks
@Z-Fran Z-Fran closed this as completed Jan 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue info/1.x an issue or a pr for 1.x branch
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants