Overriding Config Parameters Using Commands
HAT supports modifying the config parameters from the command line by adding (key, value) after --opts.
Where the key is the name of the parameter to be modified and the value is the value to be passed in, as in the config.py file:
Usage
Usgae Example
For example, we have a configuration file config.py with the following content:
Samples in this document focus on the formats of different parameters when using --opts. In your projects, the parameters and field configurations may differ from the sample.
-
keysupports multi-level parameter modification:The above command changes the value of the
model.backbonefield inconfigto"resnet50". -
valuecan be number, str, list, tuple or dict.For example, the following command can change the value of the
model.num_classesfield inconfigto 10.However, because of the parsing mechanism, you need to quote the value to be passed if its type is
tupleorlist, for example:If the value type is
str, you need to add extra quotes, for example:
