diff --git a/nerfstudio/models/depth_nerfacto.py b/nerfstudio/models/depth_nerfacto.py index 2bea84c7b..683c89e1f 100644 --- a/nerfstudio/models/depth_nerfacto.py +++ b/nerfstudio/models/depth_nerfacto.py @@ -70,7 +70,8 @@ class DepthNerfactoModel(NerfactoModel): def get_outputs(self, ray_bundle: RayBundle): outputs = super().get_outputs(ray_bundle) - outputs["directions_norm"] = ray_bundle.metadata["directions_norm"] + if ray_bundle.metadata is not None and "directions_norm" in ray_bundle.metadata: + outputs["directions_norm"] = ray_bundle.metadata["directions_norm"] return outputs def get_metrics_dict(self, outputs, batch):