Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

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

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

Already on GitHub? # to your account

Semantic of None in Configs #466

Closed
innerlee opened this issue Dec 20, 2020 · 0 comments
Closed

Semantic of None in Configs #466

innerlee opened this issue Dec 20, 2020 · 0 comments
Assignees

Comments

@innerlee
Copy link
Contributor

innerlee commented Dec 20, 2020

Background

In a layered config system, a later layer will override config values of previous layers. A typical layered configuration system is https://docs.microsoft.com/en-us/aspnet/core/fundamentals/configuration/?view=aspnetcore-5.0, where a rough order of config files.json -> ENV VARIABLES -> cmd line args is presented.

Motivation

In such config systems, we need a way to represent the semantic of "not-set". For example, suppose we have an argument normalization type in both config file and in cmd args.

  • Case 1. Use None to represent not set
    • Then we can make the normalization type in cmd args defaults to None, and values in config files would be kept.
  • Case 2. None is a valid normalization type.
    • Then there is no way to specify normalization type in config file, because it will be overridden anyway.

Proposal

  • For all our configurations, reserve None as not set. If you want to represent none, use str 'none'.
  • In the configuration merging logic, ignore an entry if the value is None.

Status Quo

The current merging logic in https://github.com/open-mmlab/mmcv/blob/master/mmcv/utils/config.py#L193-L244 does not treat None in any special way, and causing problems in #463.

@open-mmlab open-mmlab locked and limited conversation to collaborators Feb 23, 2021

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Projects
None yet
Development

No branches or pull requests

2 participants