diff --git a/CHANGELOG.md b/CHANGELOG.md index 88e1beda101..25921b9d4c8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ All notable changes to this project will be documented in this file. - Update ModelAPI configuration() - Add Anomaly modelAPI changes () +- Fix IBLoss enablement with DeiT-Tiny when class incremental training () ## \[v1.4.3\] diff --git a/src/otx/algorithms/classification/adapters/mmcls/models/heads/custom_vision_transformer_head.py b/src/otx/algorithms/classification/adapters/mmcls/models/heads/custom_vision_transformer_head.py index b9ce9ef6c8f..38a2d704c2c 100644 --- a/src/otx/algorithms/classification/adapters/mmcls/models/heads/custom_vision_transformer_head.py +++ b/src/otx/algorithms/classification/adapters/mmcls/models/heads/custom_vision_transformer_head.py @@ -31,3 +31,10 @@ def loss(self, cls_score, gt_label, feature=None): losses["accuracy"] = {f"top-{k}": a for k, a in zip(self.topk, acc)} losses["loss"] = loss return losses + + def forward_train(self, x, gt_label, **kwargs): + """Forward_train fuction of CustomVisionTransformerClsHead class.""" + x = self.pre_logits(x) + cls_score = self.layers.head(x) + losses = self.loss(cls_score, gt_label, feature=x) + return losses