Move loaded_options to util

Doesn't seem to work with python 3.6
This commit is contained in:
James Betker 2020-10-03 20:29:06 -06:00
parent 2d8e9a9d30
commit fc396baf1a
3 changed files with 2 additions and 4 deletions

View File

@ -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)

View File

@ -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

View File

@ -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'''