Code cleanup (#234)

This commit is contained in:
Matthew Tancik authored and GitHub committed 2022-07-31 18:22:57 -07:00
1 parent 8b414bafab
commit e35781fe85
14 files changed
+46 -68

No files matched your search

+1 -1
View File
@@ -52,7 +52,7 @@ def _load_checkpoint(config: DictConfig, graph: Graph) -> None:
if config.load_step is None:
print("Loading latest checkpoint from load_dir")
# NOTE: this is specific to the checkpoint name format
load_step = sorted([int(x[x.find("-") + 1 : x.find(".")]) for x in os.listdir(config.load_dir)])[-1]
load_step = sorted(int(x[x.find("-") + 1 : x.find(".")]) for x in os.listdir(config.load_dir))[-1]
else:
load_step = config.load_step
load_path = os.path.join(config.load_dir, f"step-{load_step:09d}.ckpt")
+1 -1
View File
@@ -212,7 +212,7 @@ def main(config: DictConfig):
unrolled_path = os.path.join(os.getcwd(), ".hydra/config.yaml")
if os.path.exists(unrolled_path):
with open(unrolled_path, "r", encoding="utf8") as f:
with open(unrolled_path, encoding="utf8") as f:
unrolled_config = yaml.safe_load(f)
logger = logging.getLogger(__name__)
logger.info("Printing current config setup")