You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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.None
to representnot set
normalization type
in cmd args defaults toNone
, and values in config files would be kept.None
is a valid normalization type.Proposal
None
asnot set
. If you want to represent none, use str'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.
The text was updated successfully, but these errors were encountered: