Skip to content

Commit 7f7c892

Browse files
committedApr 11, 2023
remove clip and dino loss in evaluation
1 parent dc3e5fc commit 7f7c892

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed
 

‎lerf/lerf.py

+5-4
Original file line numberDiff line numberDiff line change
@@ -206,10 +206,11 @@ def _get_outputs_nerfacto(self, ray_samples: RaySamples):
206206

207207
def get_loss_dict(self, outputs, batch, metrics_dict=None):
208208
loss_dict = super().get_loss_dict(outputs, batch, metrics_dict)
209-
loss_dict["clip_loss"] = self.config.clip_loss_weight * torch.nn.functional.huber_loss(
210-
outputs["clip"], batch["clip"], delta=1.25
211-
)
212-
loss_dict["dino_loss"] = torch.nn.functional.mse_loss(outputs["dino"], batch["dino"])
209+
if self.training:
210+
loss_dict["clip_loss"] = self.config.clip_loss_weight * torch.nn.functional.huber_loss(
211+
outputs["clip"], batch["clip"], delta=1.25
212+
)
213+
loss_dict["dino_loss"] = torch.nn.functional.mse_loss(outputs["dino"], batch["dino"])
213214
return loss_dict
214215

215216
def get_param_groups(self) -> Dict[str, List[Parameter]]:

0 commit comments

Comments
 (0)