Skip to content

Commit 2e3be74

Browse files
authored
Fix label info on loading checkpoint (#4200)
* Update on_load_checkpoint `LabelInfo`
1 parent 396be9c commit 2e3be74

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,10 @@ All notable changes to this project will be documented in this file.
6666
(<https://github.com/openvinotoolkit/training_extensions/pull/4173>)
6767
- Fix arrow support for semantic segmentation task
6868
(<https://github.com/openvinotoolkit/training_extensions/pull/4172>)
69+
- Fix backward compatibility issues in model checkpoint loading
70+
(<https://github.com/openvinotoolkit/training_extensions/pull/4199>)
71+
- Fix label info on loading checkpoint
72+
(<https://github.com/openvinotoolkit/training_extensions/pull/4200>)
6973

7074
## \[2.2.2\]
7175

src/otx/core/model/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@ def on_load_checkpoint(self, checkpoint: dict[str, Any]) -> None:
394394
ckpt_label_info = LabelInfo(
395395
label_groups=ckpt_label_info.label_groups,
396396
label_names=ckpt_label_info.label_names,
397-
label_ids=[str(i) for i in range(len(ckpt_label_info.label_names))],
397+
label_ids=ckpt_label_info.label_names,
398398
)
399399
self._label_info = ckpt_label_info
400400

0 commit comments

Comments
 (0)