Options fix?

This commit is contained in:
James Betker 2020-10-03 20:27:12 -06:00
parent e3294939b0
commit 2d8e9a9d30

View File

@ -14,7 +14,7 @@ from torchvision.utils import make_grid
from shutil import get_terminal_size from shutil import get_terminal_size
import scp import scp
import paramiko import paramiko
import options.options as options from options.options import loaded_options
from torch.utils.checkpoint import checkpoint from torch.utils.checkpoint import checkpoint
import yaml import yaml
@ -45,7 +45,7 @@ def OrderedYaml():
# Conditionally uses torch's checkpoint functionality if it is enabled in the opt file. # Conditionally uses torch's checkpoint functionality if it is enabled in the opt file.
def checkpoint(fn, *args): 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: if enabled:
return torch.utils.checkpoint.checkpoint(fn, *args) return torch.utils.checkpoint.checkpoint(fn, *args)
else: else: