mirror of
https://github.com/nerfstudio-project/nerfstudio.git
synced 2026-11-13 03:14:00 +08:00
Fix circular imports (#1115)
* wip * remove bad changes * update dmeo * cleanup * change name * cleanup
This commit is contained in:
1 parent
986f3a565d
commit
98f13cbed4
11 files changed
+175
-161
No files matched your search
@@ -26,7 +26,6 @@ from typing_extensions import Literal, assert_never
|
||||
|
||||
from nerfstudio.cameras.camera_paths import get_path_from_json, get_spiral_path
|
||||
from nerfstudio.cameras.cameras import Cameras
|
||||
from nerfstudio.configs.base_config import Config # pylint: disable=unused-import
|
||||
from nerfstudio.pipelines.base_pipeline import Pipeline
|
||||
from nerfstudio.utils import install_checks
|
||||
from nerfstudio.utils.eval_utils import eval_setup
|
||||
|
||||
+7
-7
@@ -45,8 +45,8 @@ import tyro
|
||||
import yaml
|
||||
from rich.console import Console
|
||||
|
||||
from nerfstudio.configs import base_config as cfg
|
||||
from nerfstudio.configs.config_utils import convert_markup_to_ansi
|
||||
from nerfstudio.configs.experiment_config import ExperimentConfig
|
||||
from nerfstudio.configs.method_configs import AnnotatedBaseConfigUnion
|
||||
from nerfstudio.engine.trainer import Trainer
|
||||
from nerfstudio.utils import comms, profiler
|
||||
@@ -74,7 +74,7 @@ def _set_random_seed(seed) -> None:
|
||||
torch.manual_seed(seed)
|
||||
|
||||
|
||||
def train_loop(local_rank: int, world_size: int, config: cfg.Config, global_rank: int = 0):
|
||||
def train_loop(local_rank: int, world_size: int, config: ExperimentConfig, global_rank: int = 0):
|
||||
"""Main training function that sets up and runs the trainer per process
|
||||
|
||||
Args:
|
||||
@@ -95,7 +95,7 @@ def _distributed_worker(
|
||||
num_gpus_per_machine: int,
|
||||
machine_rank: int,
|
||||
dist_url: str,
|
||||
config: cfg.Config,
|
||||
config: ExperimentConfig,
|
||||
timeout: timedelta = DEFAULT_TIMEOUT,
|
||||
) -> Any:
|
||||
"""Spawned distributed worker that handles the initialization of process group and handles the
|
||||
@@ -110,7 +110,7 @@ def _distributed_worker(
|
||||
dist_url: URL to connect to for distributed jobs, including protocol
|
||||
E.g., "tcp://127.0.0.1:8686".
|
||||
It can be set to "auto" to automatically select a free port on localhost.
|
||||
config: Config specifying training regimen.
|
||||
config: ExperimentConfig specifying training regimen.
|
||||
timeout: Timeout of the distributed workers.
|
||||
|
||||
Raises:
|
||||
@@ -150,7 +150,7 @@ def launch(
|
||||
num_machines: int = 1,
|
||||
machine_rank: int = 0,
|
||||
dist_url: str = "auto",
|
||||
config: Optional[cfg.Config] = None,
|
||||
config: Optional[ExperimentConfig] = None,
|
||||
timeout: timedelta = DEFAULT_TIMEOUT,
|
||||
) -> None:
|
||||
"""Function that spawns muliple processes to call on main_func
|
||||
@@ -161,7 +161,7 @@ def launch(
|
||||
num_machines (int, optional): total number of machines
|
||||
machine_rank (int, optional): rank of this machine.
|
||||
dist_url (str, optional): url to connect to for distributed jobs.
|
||||
config (Config, optional): config file specifying training regimen.
|
||||
config (ExperimentConfig, optional): config file specifying training regimen.
|
||||
timeout (timedelta, optional): timeout of the distributed workers.
|
||||
"""
|
||||
assert config is not None
|
||||
@@ -215,7 +215,7 @@ def launch(
|
||||
profiler.flush_profiler(config.logging)
|
||||
|
||||
|
||||
def main(config: cfg.Config) -> None:
|
||||
def main(config: ExperimentConfig) -> None:
|
||||
"""Main function."""
|
||||
|
||||
config.set_timestamp()
|
||||
|
||||
Reference in new issue
Block a user