[Fix] Use a copy of the config object in Task (#174)

This commit is contained in:
Tong Gao 2023-08-09 15:24:49 +08:00 committed by GitHub
parent d5d4f47371
commit e6194df29e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,3 +1,4 @@
import copy
import os
from abc import abstractmethod
from typing import List
@ -25,6 +26,7 @@ class BaseTask:
output_subdir: str = None
def __init__(self, cfg: ConfigDict):
cfg = copy.deepcopy(cfg)
self.cfg = cfg
self.model_cfgs = cfg['models']
self.dataset_cfgs = cfg['datasets']