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.
This discussion was converted from issue #466 on February 23, 2021 12:08.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
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.
Beta Was this translation helpful? Give feedback.
All reactions