TrainerConfig inherit from InstantiateConfig (#1175)

Making TrainerConfig an InstantiateConfig so it can be swapped in and out with different methods. Also made the TrainerConfig a subclass of ExperimentConfig (which was changed from a printableconfig to an instantiateconfig), since we were already instantiating the Trainer class with the ExperimentConfig

Removed the "config" field from the TrainerCallbackAttributes struct to eliminate circular dependencies when types are checked.

Minor scripts and docs changes to accommodate the update to the config struct, meaning the flags that were associated with the TrainerConfig were moved up to the top level of the config.
This commit is contained in:
Jake Austin authored and GitHub committed 2022-12-27 18:19:34 -10:00
1 parent b1dfd28cb6
commit 3ffee522e0
13 files changed
+114 -114

No files matched your search

+3 -3
View File
@@ -9,19 +9,19 @@ from pathlib import Path
import pytest
from nerfstudio.configs.experiment_config import ExperimentConfig
from nerfstudio.configs.method_configs import method_configs
from nerfstudio.data.dataparsers.blender_dataparser import BlenderDataParserConfig
from nerfstudio.data.dataparsers.minimal_dataparser import MinimalDataParserConfig
from nerfstudio.engine.trainer import TrainerConfig
from scripts.train import train_loop
BLACKLIST = ["base", "semantic-nerfw", "instant-ngp", "instant-ngp-bounded", "nerfacto", "phototourism"]
def set_reduced_config(config: ExperimentConfig):
def set_reduced_config(config: TrainerConfig):
"""Reducing the config settings to speedup test"""
config.machine.num_gpus = 0
config.trainer.max_num_iterations = 2
config.max_num_iterations = 2
# reduce dataset factors; set dataset to test
config.pipeline.datamanager.dataparser = BlenderDataParserConfig(data=Path("tests/data/lego_test"))
config.pipeline.datamanager.train_num_images_to_sample_from = 1