Skip to content

Commit

Permalink
Hot fix engine.test checkpoint (#2846)
Browse files Browse the repository at this point in the history
* Hot fix engine.test checkpoint

* Fix minor

* Add xfail in intg_test with action_cls
  • Loading branch information
harimkang authored Jan 29, 2024
1 parent 35d202e commit 96b6b2a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/otx/engine/engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,8 +263,9 @@ def test(

# NOTE, trainer.test takes only lightning based checkpoint.
# So, it can't take the OTX1.x checkpoint.
if self.checkpoint is not None:
loaded_checkpoint = torch.load(self.checkpoint)
checkpoint = checkpoint if checkpoint is not None else self.checkpoint
if checkpoint is not None:
loaded_checkpoint = torch.load(checkpoint)
lit_module.load_state_dict(loaded_checkpoint)

self._build_trainer(**kwargs)
Expand Down
2 changes: 2 additions & 0 deletions tests/integration/cli/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ def test_otx_e2e(recipe: str, tmp_path: Path, fxt_accelerator: str) -> None:
"""
task = recipe.split("/")[-2]
model_name = recipe.split("/")[-1].split(".")[0]
if task in ("action_classification"):
pytest.xfail(reason="xFail until this root cause is resolved on the Datumaro side.")

# 1) otx train
tmp_path_train = tmp_path / f"otx_train_{model_name}"
Expand Down

0 comments on commit 96b6b2a

Please sign in to comment.