Skip to content

Commit

Permalink
Trainer can now always save dataparser transform (#2653)
Browse files Browse the repository at this point in the history
* Trainer can now always save dataparser transform

* appease the linter

---------

Co-authored-by: Brent Yi <[email protected]>
  • Loading branch information
pwais and brentyi authored Dec 11, 2023
1 parent 1d9cc7d commit 390b633
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions nerfstudio/engine/trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@

import torch
from nerfstudio.configs.experiment_config import ExperimentConfig
from nerfstudio.data.datamanagers.base_datamanager import VanillaDataManager
from nerfstudio.engine.callbacks import TrainingCallback, TrainingCallbackAttributes, TrainingCallbackLocation
from nerfstudio.engine.optimizers import Optimizers
from nerfstudio.pipelines.base_pipeline import VanillaPipeline
Expand Down Expand Up @@ -225,11 +224,9 @@ def train(self) -> None:
"""Train the model."""
assert self.pipeline.datamanager.train_dataset is not None, "Missing DatsetInputs"

# don't want to call save_dataparser_transform if pipeline's datamanager does not have a dataparser
if isinstance(self.pipeline.datamanager, VanillaDataManager):
self.pipeline.datamanager.train_dataparser_outputs.save_dataparser_transform(
self.base_dir / "dataparser_transforms.json"
)
self.pipeline.datamanager.train_dataparser_outputs.save_dataparser_transform(
self.base_dir / "dataparser_transforms.json"
)

self._init_viewer_state()
with TimeWriter(writer, EventName.TOTAL_TRAIN_TIME):
Expand Down

0 comments on commit 390b633

Please sign in to comment.