diff --git a/codes/options/options.py b/codes/options/options.py index be42de2f..bead66c4 100644 --- a/codes/options/options.py +++ b/codes/options/options.py @@ -5,8 +5,6 @@ import yaml from utils.util import OrderedYaml Loader, Dumper = OrderedYaml() -loaded_options = None - def parse(opt_path, is_train=True): with open(opt_path, mode='r') as f: opt = yaml.load(f, Loader=Loader) diff --git a/codes/train.py b/codes/train.py index 6c390eb9..e61abe71 100644 --- a/codes/train.py +++ b/codes/train.py @@ -127,7 +127,7 @@ def main(): # torch.autograd.set_detect_anomaly(True) # Save the compiled opt dict to the global loaded_options variable. - option.loaded_options = opt + util.loaded_options = opt #### create train and val dataloader dataset_ratio = 1 # enlarge the size of each epoch diff --git a/codes/utils/util.py b/codes/utils/util.py index 1f2f82d1..2dd3378f 100644 --- a/codes/utils/util.py +++ b/codes/utils/util.py @@ -14,7 +14,6 @@ from torchvision.utils import make_grid from shutil import get_terminal_size import scp import paramiko -from options.options import loaded_options from torch.utils.checkpoint import checkpoint import yaml @@ -23,6 +22,7 @@ try: except ImportError: from yaml import Loader, Dumper +loaded_options = None def OrderedYaml(): '''yaml orderedDict support'''