mirror of
https://github.com/nerfstudio-project/nerfstudio.git
synced 2026-11-11 10:34:29 +08:00
move no input data flag from pipeline to datamanager
This commit is contained in:
parent
de51b12524
commit
cb10a77cae
@ -455,7 +455,6 @@ method_configs["dreamfusion"] = TrainerConfig(
|
||||
max_num_iterations=30000,
|
||||
mixed_precision=True,
|
||||
pipeline=VanillaPipelineConfig(
|
||||
no_input_data=True,
|
||||
datamanager=DreamFusionDataManagerConfig(
|
||||
horizontal_rotation_warmup=2000,
|
||||
),
|
||||
|
||||
@ -409,6 +409,7 @@ class VanillaDataManager(DataManager, Generic[TDataset]): # pylint: disable=abs
|
||||
self.test_mode = test_mode
|
||||
self.test_split = "test" if test_mode in ["test", "inference"] else "val"
|
||||
self.dataparser_config = self.config.dataparser
|
||||
self.input_data = True
|
||||
if self.config.data is not None:
|
||||
self.config.dataparser.data = Path(self.config.data)
|
||||
else:
|
||||
|
||||
@ -212,6 +212,7 @@ class DreamFusionDataManager(DataManager): # pylint: disable=abstract-method
|
||||
self.sampler = None
|
||||
self.test_mode = test_mode
|
||||
self.test_split = "test" if test_mode in ["test", "inference"] else "val"
|
||||
self.input_data = False
|
||||
|
||||
if self.config.data is not None:
|
||||
CONSOLE.print("[red] --data should not be used with the DreamFusionDataManager[/red]")
|
||||
|
||||
@ -223,7 +223,7 @@ class Trainer:
|
||||
"""Train the model."""
|
||||
assert self.pipeline.datamanager.train_dataset is not None, "Missing DatsetInputs"
|
||||
|
||||
if not self.pipeline.no_input_data:
|
||||
if self.pipeline.datamanager.input_data:
|
||||
self.pipeline.datamanager.train_dataparser_outputs.save_dataparser_transform(
|
||||
self.base_dir / "dataparser_transforms.json"
|
||||
)
|
||||
|
||||
@ -95,7 +95,6 @@ class Pipeline(nn.Module):
|
||||
|
||||
datamanager: DataManager
|
||||
_model: Model
|
||||
generative: bool
|
||||
world_size: int
|
||||
|
||||
@property
|
||||
@ -211,8 +210,6 @@ class VanillaPipelineConfig(cfg.InstantiateConfig):
|
||||
"""specifies the datamanager config"""
|
||||
model: ModelConfig = ModelConfig()
|
||||
"""specifies the model config"""
|
||||
no_input_data: bool = False
|
||||
"""specifies whether the pipeline is expects an input dataset"""
|
||||
|
||||
|
||||
class VanillaPipeline(Pipeline):
|
||||
@ -248,7 +245,6 @@ class VanillaPipeline(Pipeline):
|
||||
self.datamanager: VanillaDataManager = config.datamanager.setup(
|
||||
device=device, test_mode=test_mode, world_size=world_size, local_rank=local_rank
|
||||
)
|
||||
self.no_input_data = config.no_input_data
|
||||
self.datamanager.to(device)
|
||||
# TODO(ethan): get rid of scene_bounds from the model
|
||||
assert self.datamanager.train_dataset is not None, "Missing input dataset"
|
||||
|
||||
Loading…
Reference in New Issue
Block a user