diff --git a/codes/utils/util.py b/codes/utils/util.py index c3ca12b8..1f2f82d1 100644 --- a/codes/utils/util.py +++ b/codes/utils/util.py @@ -14,7 +14,7 @@ from torchvision.utils import make_grid from shutil import get_terminal_size import scp import paramiko -import options.options as options +from options.options import loaded_options from torch.utils.checkpoint import checkpoint import yaml @@ -45,7 +45,7 @@ def OrderedYaml(): # Conditionally uses torch's checkpoint functionality if it is enabled in the opt file. def checkpoint(fn, *args): - enabled = options.loaded_options['checkpointing_enabled'] if 'checkpointing_enabled' in options.loaded_options.keys() else True + enabled = loaded_options['checkpointing_enabled'] if 'checkpointing_enabled' in loaded_options.keys() else True if enabled: return torch.utils.checkpoint.checkpoint(fn, *args) else: