[Feature Request] Allow environment variables in yaml file
Mengman opened this issue · 1 comments
Mengman commented
I hope yacs can support use environment variable in yaml file.
for example
TRAIN:
GPU_ID:${GPU:1}
GPU
is the environment variable, if environment variable does not exist the value after colon 1
will be used.
rbgirshick commented
I suggest that in your code that uses yacs, you can load the relevant env variables and then use CfgNode.merge_from_list
to make them override the default values. I think this does not need to be directly supported via a syntax extension. Example usage: https://github.com/rbgirshick/yacs/blob/master/yacs/tests.py#L314-L326.