From 006008b72f4e2c1b93b73393ea2e6f3044a56cc6 Mon Sep 17 00:00:00 2001 From: Kyle Corbitt Date: Sat, 15 Oct 2022 03:55:01 +0200 Subject: [PATCH] Respect custom timestamps passed to `ns-train` (#778) When using `ns-train` as part of a pipeline, it's convenient for the output directory to be deterministic. This should be achievable by passing the `--timestamp` argument to `ns-train`, but that argument is currently being overwritten. This PR fixes the logic to respect a custom user-provided `--timestamp` value. --- nerfstudio/configs/base_config.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nerfstudio/configs/base_config.py b/nerfstudio/configs/base_config.py index cecbc6ffe..68ba9ee80 100644 --- a/nerfstudio/configs/base_config.py +++ b/nerfstudio/configs/base_config.py @@ -231,7 +231,8 @@ class Config(PrintableConfig): def set_timestamp(self) -> None: """Dynamically set the experiment timestamp""" - self.timestamp = datetime.now().strftime("%Y-%m-%d_%H%M%S") + if self.timestamp == "{timestamp}": + self.timestamp = datetime.now().strftime("%Y-%m-%d_%H%M%S") def set_experiment_name(self) -> None: """Dynamically set the experiment name"""