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:
Examples 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 example.
key supports multi-level parameter modification:
The above command changes the value of the model.backbone field in config to "resnet50".
value can be number, str, list, or tuple, but dict is not supported.
For example, the following command can change the value of the model.num_classes field in config to 10.
However, because of the parsing mechanism, you need to quote the value to be passed if its type is tuple or list, for example:
If the value type is str, you need to add extra quotes, for example: