Fix circular imports (#1115)

* wip

* remove bad changes

* update dmeo

* cleanup

* change name

* cleanup
This commit is contained in:
Nikhil Mohan authored and GitHub committed 2022-12-13 10:09:31 -08:00
1 parent 986f3a565d
commit 98f13cbed4
11 files changed
+175 -161

No files matched your search

+5 -4
View File
@@ -27,13 +27,14 @@ import yaml
from rich.console import Console
from typing_extensions import Literal
from nerfstudio.configs import base_config as cfg
from nerfstudio.configs.base_config import TrainerConfig
from nerfstudio.configs.experiment_config import ExperimentConfig
from nerfstudio.pipelines.base_pipeline import Pipeline
CONSOLE = Console(width=120)
def eval_load_checkpoint(config: cfg.TrainerConfig, pipeline: Pipeline) -> Path:
def eval_load_checkpoint(config: TrainerConfig, pipeline: Pipeline) -> Path:
## TODO: ideally eventually want to get this to be the same as whatever is used to load train checkpoint too
"""Helper function to load checkpointed pipeline
@@ -68,7 +69,7 @@ def eval_setup(
config_path: Path,
eval_num_rays_per_chunk: Optional[int] = None,
test_mode: Literal["test", "val", "inference"] = "test",
) -> Tuple[cfg.Config, Pipeline, Path]:
) -> Tuple[ExperimentConfig, Pipeline, Path]:
"""Shared setup for loading a saved pipeline for evaluation.
Args:
@@ -85,7 +86,7 @@ def eval_setup(
"""
# load save config
config = yaml.load(config_path.read_text(), Loader=yaml.Loader)
assert isinstance(config, cfg.Config)
assert isinstance(config, ExperimentConfig)
if eval_num_rays_per_chunk:
config.pipeline.model.eval_num_rays_per_chunk = eval_num_rays_per_chunk
+3 -3
View File
@@ -188,7 +188,7 @@ def setup_local_writer(config: cfg.LoggingConfig, max_iter: int, banner_messages
@check_main_thread
def setup_event_writer(config: cfg.Config, log_dir: Path) -> None:
def setup_event_writer(is_wandb_enabled: bool, is_tensorboard_enabled: bool, log_dir: Path) -> None:
"""Initialization of all event writers specified in config
Args:
@@ -197,11 +197,11 @@ def setup_event_writer(config: cfg.Config, log_dir: Path) -> None:
banner_messages: list of messages to always display at bottom of screen
"""
using_event_writer = False
if config.is_wandb_enabled():
if is_wandb_enabled:
curr_writer = WandbWriter(log_dir=log_dir)
EVENT_WRITERS.append(curr_writer)
using_event_writer = True
if config.is_tensorboard_enabled():
if is_tensorboard_enabled:
curr_writer = TensorboardWriter(log_dir=log_dir)
EVENT_WRITERS.append(curr_writer)
using_event_writer = True