π Geometric Computer Vision Library for Spatial AI
Python artificial-intelligencecomputer-visiondeep-learninghacktoberfestimage-processingmachine-learningneural-networkpythonpytorchroboticsspatial-ai
update (#1535)
Jian Shi06ba07b6c69c
diff --git a/kornia/x/trainers.py b/kornia/x/trainers.pyindex e8a2d3cfc..88986e8d3 100644--- a/kornia/x/trainers.py+++ b/kornia/x/trainers.py@@ -88,6 +88,9 @@ class ObjectDetectionTrainer(Trainer):def compute_loss(self, *args: torch.Tensor) -> torch.Tensor:if self.loss_computed_by_model:+ # Note: in case of dict losses obtained+ if isinstance(args[0], dict):+ return torch.stack([v for _, v in args[0].items()]).mean()return torch.stack(list(args[0])).sum()if self.criterion is None:raise RuntimeError("`criterion` should not be None if `loss_computed_by_model` is False.")