(config, cfg_file)
| 154 | |
| 155 | |
| 156 | def _update_config_from_file(config, cfg_file): |
| 157 | config.defrost() |
| 158 | with open(cfg_file, 'r') as f: |
| 159 | yaml_cfg = yaml.load(f, Loader=yaml.FullLoader) |
| 160 | |
| 161 | for cfg in yaml_cfg.setdefault('BASE', ['']): |
| 162 | if cfg: |
| 163 | _update_config_from_file( |
| 164 | config, os.path.join(os.path.dirname(cfg_file), cfg) |
| 165 | ) |
| 166 | print('=> merge config from {}'.format(cfg_file)) |
| 167 | config.merge_from_file(cfg_file) |
| 168 | config.freeze() |
| 169 | |
| 170 | |
| 171 | def update_config(config, args): |