MaskRCNN NNCF optimization failure
Describe the bug
MaskRCNN optimization is failing with the below error
Error stacktrace
``` File "/home/devuser/training_extensions/library/src/getitune/backend/openvino/engine.py", line 372, in optimize return model.optimize( ~~~~~~~~~~~~~~^ Path(self.work_dir), ^^^^^^^^^^^^^^^^^^^^ optimize_datamodule, ^^^^^^^^^^^^^^^^^^^^ ptq_config, ^^^^^^^^^^^ ) ^ File "/home/devuser/training_extensions/library/src/getitune/backend/openvino/models/base.py", line 351, in optimize compressed_model = nncf.quantize( model=ov_model, calibration_dataset=quantization_dataset, **ptq_config, ) File "/home/devuser/training_extensions/library/.venv/lib/python3.13/site-packages/nncf/telemetry/decorator.py", line 81, in wrapped retval = fn(*args, **kwargs) File "/home/devuser/training_extensions/library/.venv/lib/python3.13/site-packages/nncf/quantization/quantize_model.py", line 189, in quantize return quantize_impl( # type: ignore[no-any-return] model=model, ...<8 lines>... advanced_parameters=advanced_parameters, ) File "/home/devuser/training_extensions/library/.venv/lib/python3.13/site-packages/nncf/openvino/quantization/quantize_model.py", line 351, in quantize_impl return quantize_fn( model=model, ...<8 lines>... advanced_parameters=advanced_parameters, ) File "/home/devuser/training_extensions/library/.venv/lib/python3.13/site-packages/nncf/openvino/quantization/quantize_model.py", line 122, in native_quantize_if_op_impl quantized_model, _ = apply_algorithm_if_bodies( ~~~~~~~~~~~~~~~~~~~~~~~~~^ quantization_algorithm, model, graphs, main_model_graph_id, calibration_dataset, subset_size, 1 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ) ^ File "/home/devuser/training_extensions/library/.venv/lib/python3.13/site-packages/nncf/openvino/quantization/quantize_ifmodel.py", line 157, in apply_algorithm_if_bodies quantized_model = algorithm.apply(parent_model, parent_graph, parent_statistic_points, parent_dataset) File "/home/devuser/training_extensions/library/.venv/lib/python3.13/site-packages/nncf/quantization/algorithms/post_training/algorithm.py", line 113, in apply return self._pipeline.run_from_step(model, dataset, graph, 0, step_index_to_statistics) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/devuser/training_extensions/library/.venv/lib/python3.13/site-packages/nncf/quantization/algorithms/pipeline.py", line 164, in run_from_step step_model = self.run_step(step_index, step_statistics, step_model, step_graph) File "/home/devuser/training_extensions/library/.venv/lib/python3.13/site-packages/nncf/quantization/algorithms/pipeline.py", line 117, in run_step current_model = algorithm.apply(current_model, current_graph, step_statistics) File "/home/devuser/training_extensions/library/.venv/lib/python3.13/site-packages/nncf/quantization/algorithms/min_max/algorithm.py", line 1071, in apply raise nncf.InternalError(msg) nncf.errors.InternalError: Statistics were not collected for the node __module.model.roi_heads.mask_roi_pool/aten::scatter/Slice_3 ```The goal is to figure out what is causing this error instead of ignoring quantization of this layer.
Steps to Reproduce
- Train maskrcnn_r50 on WGISD dataset with default settings
- Optimize model with default settings
Tested on latest develop, cannot reproduce anymore.
It isn't reproducible as there is a workaround implemented as mentioned in the description. This issue was opened to find a proper solution instead of ignoring quantization of the problematic layer.
I see, I thought the job would fail based on the title of this issue.
I've just checked if the quantized model at least generates good predictions, but it doesn't: for me, the MaskRCNN INT8 variant always returns empty predictions unlike the FP16 one.
"I've just checked if the quantized model at least generates good predictions, but it doesn't:" -> I think it is separate issue. We need to investigate
This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 30 days.