mirror of
https://github.com/nerfstudio-project/nerfstudio.git
synced 2026-11-24 18:14:16 +08:00
Fix viewer when opened before train setup finishes (#1888)
* Fix viewer when opened before train setup finishes * is_initialized fix docs
This commit is contained in:
1 parent
df514b121c
commit
935e308c93
2 files changed
+13
-5
No files matched your search
@@ -187,6 +187,13 @@ def setup_local_writer(config: cfg.LoggingConfig, max_iter: int, banner_messages
|
||||
GLOBAL_BUFFER["events"] = {}
|
||||
|
||||
|
||||
def is_initialized():
|
||||
"""
|
||||
Returns True after setup_local_writer was called
|
||||
"""
|
||||
return "events" in GLOBAL_BUFFER
|
||||
|
||||
|
||||
@check_main_thread
|
||||
def setup_event_writer(
|
||||
is_wandb_enabled: bool,
|
||||
@@ -273,7 +280,7 @@ class TimeWriter:
|
||||
def __exit__(self, *args):
|
||||
self.duration = time() - self.start
|
||||
update_step = self.step is not None
|
||||
if self.write:
|
||||
if self.write and is_initialized():
|
||||
self.writer.put_time(
|
||||
name=self.name,
|
||||
duration=self.duration,
|
||||
|
||||
Reference in new issue
Block a user