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