question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

use site-packages/${project}/.mim/config as the base config

See original GitHub issue

Describe the feature I would like to be able to specify the config under .mim as the base config and run it as shown below.

_base_ = [
    'site-packages/mmcls/.mim/config/_base_/models/resnet18_cifar.py',
    'site-packages/mmcls/.mim/config/_base_/datasets/cifar10_bs16.py',
    'site-packages/mmcls/.mim/config/_base_/schedules/cifar10_bs128.py',
    'site-packages/mmcls/.mim/config/_base_/default_runtime.py'
]

Motivation When specifying the config in the repo as the base config, I find it inconvenient that I need to either download it locally by git clone or copy the config to be used itself under .mim.

Additional context The following part of mmcv is the load part of the base config. I think it is possible to load the config from .mim by changing this part, is this the proper way? https://github.com/open-mmlab/mmcv/blob/76cfd77b3a88ce17508471bf335829eb0628abcf/mmcv/utils/config.py#L239-L269

Is this the proper way to do it, or is there a way to complete it with a .mim repo?

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:2
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
okotakucommented, Sep 21, 2022

Cool! Thank you for your great effort:)

1reaction
zhouzaidacommented, Nov 17, 2021

Hi, it is a great idea. In fact, mmcv also supports loading base config with an absolute path.

        if BASE_KEY in cfg_dict:
            cfg_dir = osp.dirname(filename)
            base_filename = cfg_dict.pop(BASE_KEY)
            base_filename = base_filename if isinstance(
                base_filename, list) else [base_filename]

            cfg_dict_list = list()
            cfg_text_list = list()
            for f in base_filename:
                _cfg_dict, _cfg_text = Config._file2dict(osp.join(cfg_dir, f))
                cfg_dict_list.append(_cfg_dict)
                cfg_text_list.append(_cfg_text)

https://github.com/open-mmlab/mmcv/blob/76cfd77b3a88ce17508471bf335829eb0628abcf/mmcv/utils/config.py#L248

If the f is an absolute path, the osp.join(cfg_dir, f) will return the f without concatenating the cfg_dir

Read more comments on GitHub >

github_iconTop Results From Across the Web

MIM Config Documenter tool now availiable on GitHub
MIM configuration documenter is a tool to generate documentation of a MIM / FIM synchronization or service installation.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found