mirror of
https://github.com/nerfstudio-project/nerfstudio.git
synced 2026-12-07 00:09:14 +08:00
auto set experiment name (#484)
changed experiment/method name requirements
This commit is contained in:
1 parent
c2a2b1de1e
commit
211515c633
3 files changed
+16
-12
No files matched your search
@@ -92,7 +92,7 @@ class TensorboardWriterConfig(InstantiateConfig):
|
|||||||
_target: Type = writer.TensorboardWriter
|
_target: Type = writer.TensorboardWriter
|
||||||
"""target class to instantiate"""
|
"""target class to instantiate"""
|
||||||
log_dir: dcargs.conf.Fixed[Path] = dcargs.MISSING
|
log_dir: dcargs.conf.Fixed[Path] = dcargs.MISSING
|
||||||
"""auto-populated absolute path to saved tensorboard events"""
|
"""[Do not set] Auto-populated absolute path to saved tensorboard events"""
|
||||||
|
|
||||||
|
|
||||||
@dataclass
|
@dataclass
|
||||||
@@ -102,7 +102,7 @@ class WandbWriterConfig(InstantiateConfig):
|
|||||||
_target: Type = writer.WandbWriter
|
_target: Type = writer.WandbWriter
|
||||||
"""target class to instantiate"""
|
"""target class to instantiate"""
|
||||||
log_dir: dcargs.conf.Fixed[Path] = dcargs.MISSING
|
log_dir: dcargs.conf.Fixed[Path] = dcargs.MISSING
|
||||||
"""auto-populated absolute path to saved wandb events"""
|
"""[Do not set] Auto-populated absolute path to saved wandb events"""
|
||||||
|
|
||||||
|
|
||||||
@dataclass
|
@dataclass
|
||||||
@@ -147,7 +147,7 @@ class LoggingConfig(PrintableConfig):
|
|||||||
event_writer: Literal["tb", "wandb", "none"] = "wandb"
|
event_writer: Literal["tb", "wandb", "none"] = "wandb"
|
||||||
"""specify which writer to use (tensorboard or wandb)"""
|
"""specify which writer to use (tensorboard or wandb)"""
|
||||||
event_writer_config: dcargs.conf.Fixed[Optional[Union[TensorboardWriterConfig, WandbWriterConfig]]] = dcargs.MISSING
|
event_writer_config: dcargs.conf.Fixed[Optional[Union[TensorboardWriterConfig, WandbWriterConfig]]] = dcargs.MISSING
|
||||||
"""dynamically set the writer config based on the writer"""
|
"""[Do not set] Writer config based on the specified event_writer. Set automatically."""
|
||||||
local_writer: LocalWriterConfig = LocalWriterConfig(enable=True)
|
local_writer: LocalWriterConfig = LocalWriterConfig(enable=True)
|
||||||
"""if provided, will print stats locally. if None, will disable printing"""
|
"""if provided, will print stats locally. if None, will disable printing"""
|
||||||
enable_profiler: bool = True
|
enable_profiler: bool = True
|
||||||
@@ -175,7 +175,7 @@ class TrainerConfig(PrintableConfig):
|
|||||||
relative_model_dir: Path = Path("nerfactory_models/")
|
relative_model_dir: Path = Path("nerfactory_models/")
|
||||||
"""relative path to save all checkpoints"""
|
"""relative path to save all checkpoints"""
|
||||||
model_dir: dcargs.conf.Fixed[Path] = dcargs.MISSING
|
model_dir: dcargs.conf.Fixed[Path] = dcargs.MISSING
|
||||||
"""auto-populated absolute path to saved checkpoints"""
|
"""[Do not set] Auto-populated absolute path to saved checkpoints. Set automatically."""
|
||||||
# optional parameters if we want to resume training
|
# optional parameters if we want to resume training
|
||||||
load_dir: Optional[Path] = None
|
load_dir: Optional[Path] = None
|
||||||
"""optionally specify a pre-trained model directory to load from"""
|
"""optionally specify a pre-trained model directory to load from"""
|
||||||
@@ -396,10 +396,12 @@ class SchedulerConfig(InstantiateConfig):
|
|||||||
class Config(PrintableConfig):
|
class Config(PrintableConfig):
|
||||||
"""Full config contents"""
|
"""Full config contents"""
|
||||||
|
|
||||||
experiment_name: str = "blender_lego"
|
method_name: Optional[str] = None
|
||||||
method_name: str = "base_method"
|
"""Method name. Required to set in python or via cli"""
|
||||||
|
experiment_name: Optional[str] = None
|
||||||
|
"""Experiment name. If None, will automatically be set to dataset name"""
|
||||||
base_dir: dcargs.conf.Fixed[Path] = dcargs.MISSING
|
base_dir: dcargs.conf.Fixed[Path] = dcargs.MISSING
|
||||||
"""Experiment base directory. Set automatically."""
|
"""[Do not set] Experiment base directory. Set automatically."""
|
||||||
machine: MachineConfig = MachineConfig()
|
machine: MachineConfig = MachineConfig()
|
||||||
logging: LoggingConfig = LoggingConfig()
|
logging: LoggingConfig = LoggingConfig()
|
||||||
viewer: ViewerConfig = ViewerConfig()
|
viewer: ViewerConfig = ViewerConfig()
|
||||||
@@ -425,6 +427,10 @@ class Config(PrintableConfig):
|
|||||||
timestamp: Timestamp to use, as a string. If None, defaults to the current
|
timestamp: Timestamp to use, as a string. If None, defaults to the current
|
||||||
time in the form YYYY-MM-DD_HHMMMSS.
|
time in the form YYYY-MM-DD_HHMMMSS.
|
||||||
"""
|
"""
|
||||||
|
# check the experiment and method names
|
||||||
|
assert self.method_name is not None, "Please set method name in config or via the cli"
|
||||||
|
if self.experiment_name is None:
|
||||||
|
self.experiment_name = str(self.pipeline.datamanager.train_dataparser.data_directory).replace("/", "-")
|
||||||
|
|
||||||
# set the timestamp of the model logging/writer loggign paths
|
# set the timestamp of the model logging/writer loggign paths
|
||||||
if timestamp is None:
|
if timestamp is None:
|
||||||
|
|||||||
@@ -64,7 +64,6 @@ base_configs["instant-ngp"] = Config(
|
|||||||
)
|
)
|
||||||
|
|
||||||
base_configs["mipnerf-360"] = Config(
|
base_configs["mipnerf-360"] = Config(
|
||||||
experiment_name="mipnerf-360",
|
|
||||||
method_name="mipnerf-360",
|
method_name="mipnerf-360",
|
||||||
trainer=TrainerConfig(steps_per_eval_batch=200),
|
trainer=TrainerConfig(steps_per_eval_batch=200),
|
||||||
pipeline=PipelineConfig(
|
pipeline=PipelineConfig(
|
||||||
@@ -97,7 +96,6 @@ base_configs["mipnerf"] = Config(
|
|||||||
)
|
)
|
||||||
|
|
||||||
base_configs["nerfw"] = Config(
|
base_configs["nerfw"] = Config(
|
||||||
experiment_name="friends_TBBT-big_living_room",
|
|
||||||
method_name="nerfw",
|
method_name="nerfw",
|
||||||
pipeline=PipelineConfig(
|
pipeline=PipelineConfig(
|
||||||
datamanager=VanillaDataManagerConfig(
|
datamanager=VanillaDataManagerConfig(
|
||||||
@@ -107,8 +105,8 @@ base_configs["nerfw"] = Config(
|
|||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
base_configs["semantic-nerf"] = Config(
|
base_configs["semantic-nerf"] = Config(
|
||||||
experiment_name="friends_TBBT-big_living_room",
|
|
||||||
method_name="semantic-nerf",
|
method_name="semantic-nerf",
|
||||||
pipeline=PipelineConfig(
|
pipeline=PipelineConfig(
|
||||||
datamanager=VanillaDataManagerConfig(
|
datamanager=VanillaDataManagerConfig(
|
||||||
@@ -193,7 +191,7 @@ def _make_base_config_subcommand_type() -> Type[Config]:
|
|||||||
base_configs_placeholder_timestamp = {}
|
base_configs_placeholder_timestamp = {}
|
||||||
for name, config in base_configs.items():
|
for name, config in base_configs.items():
|
||||||
base_configs_placeholder_timestamp[name] = copy.deepcopy(config)
|
base_configs_placeholder_timestamp[name] = copy.deepcopy(config)
|
||||||
base_configs_placeholder_timestamp[name].populate_dynamic_fields("{timestamp}")
|
base_configs_placeholder_timestamp[name].populate_dynamic_fields(timestamp="{timestamp}")
|
||||||
|
|
||||||
return dcargs.extras.subcommand_type_from_defaults(base_configs_placeholder_timestamp)
|
return dcargs.extras.subcommand_type_from_defaults(base_configs_placeholder_timestamp)
|
||||||
|
|
||||||
|
|||||||
@@ -381,7 +381,7 @@ class LocalWriter:
|
|||||||
if step > 0:
|
if step > 0:
|
||||||
if not self.has_printed and self.config.max_log_size:
|
if not self.has_printed and self.config.max_log_size:
|
||||||
logging.info(
|
logging.info(
|
||||||
"\x1b[33;20mPrinting max of %d lines. Set flag `--logging.local_writer.max-log-size=0` "
|
"\x1b[33;20mPrinting max of %d lines. Set flag `--logging.local-writer.max-log-size=0` "
|
||||||
"to disable line wrapping.\x1b[0m",
|
"to disable line wrapping.\x1b[0m",
|
||||||
self.config.max_log_size,
|
self.config.max_log_size,
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in new issue
Block a user