mirror of
https://github.com/nerfstudio-project/nerfstudio.git
synced 2026-11-12 02:45:34 +08:00
Code cleanup (#234)
This commit is contained in:
1 parent
8b414bafab
commit
e35781fe85
14 files changed
+46
-68
No files matched your search
+1
-1
@@ -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")
|
||||
|
||||
@@ -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")
|
||||
|
||||
Reference in new issue
Block a user