Skip to content

Commit 26ad5d1

Browse files
author
pfinashx
committed
Added NNCF steps
1 parent a396e8b commit 26ad5d1

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

external/anomaly/ote_anomalib/nncf_task.py

+3
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
from ote_sdk.entities.datasets import DatasetEntity
3737
from ote_sdk.entities.model import (
3838
ModelEntity,
39+
ModelFormat,
3940
ModelOptimizationType,
4041
ModelPrecision,
4142
OptimizationMethod,
@@ -183,6 +184,8 @@ def optimize(
183184
self.trainer = Trainer(**self.config.trainer, logger=False, callbacks=callbacks)
184185
self.trainer.fit(model=self.model, datamodule=datamodule)
185186
self.compression_ctrl = nncf_callback.nncf_ctrl
187+
output_model.model_format = ModelFormat.BASE_FRAMEWORK
188+
output_model.optimization_type = ModelOptimizationType.NN
186189
self.save_model(output_model)
187190

188191
logger.info("Training completed.")

external/anomaly/tests/test_ote_training.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,7 @@ def test(self,
409409
test_parameters,
410410
test_case_fx, data_collector_fx,
411411
cur_test_expected_metrics_callback_fx):
412-
if "nncf" in test_parameters["test_stage"]:
413-
pytest.xfail("NNCF not yet supported for Anomaly Classification")
412+
if "nncf_graph" in test_parameters["test_stage"]:
413+
pytest.xfail("The models has no a reference NNCF graph yet")
414414
test_case_fx.run_stage(test_parameters['test_stage'], data_collector_fx,
415415
cur_test_expected_metrics_callback_fx)

0 commit comments

Comments
 (0)