Intel® Distribution of OpenVINO™ Toolkit
Community support and discussions about the Intel® Distribution of OpenVINO™ toolkit, OpenCV, and all things computer vision-related on Intel® platforms.

Post training Optimization

akshya
Employee
313 Views

Hi all,

I am doing post training optimization of faster_rcnn_resnet101 model. The model is retrained using Tensorflow object detection API and converted to OpenVINO IR formats using model optimizer. For POT, I have used the DefaultQuantization algorithm with AccuracyChecker engine. This is the error I am getting: 

Annotation conversion for custom dataset has been finished
INFO:compression.statistics.collector:Start computing statistics for algorithms : DefaultQuantization
INFO:compression.statistics.collector:Computing statistics finished
INFO:compression.pipeline.pipeline:Start algorithm: DefaultQuantization
INFO:compression.algorithms.quantization.default.algorithm:Start computing statistics for algorithm : ActivationChannelAlignment
INFO:compression.algorithms.quantization.default.algorithm:Computing statistics finished
INFO:compression.algorithms.quantization.default.algorithm:Start computing statistics for algorithms : MinMaxQuantization,FastBiasCorrection
Traceback (most recent call last):
  File "/usr/local/bin/pot", line 33, in <module>
    sys.exit(load_entry_point('pot==1.0', 'console_scripts', 'pot')())
  File "/opt/intel/openvino_2021.2.185/deployment_tools/tools/post_training_optimization_toolkit/app/run.py", line 37, in main
    app(sys.argv[1:])
  File "/opt/intel/openvino_2021.2.185/deployment_tools/tools/post_training_optimization_toolkit/app/run.py", line 56, in app
    metrics = optimize(config)
  File "/opt/intel/openvino_2021.2.185/deployment_tools/tools/post_training_optimization_toolkit/app/run.py", line 123, in optimize
    compressed_model = pipeline.run(model)
  File "/opt/intel/openvino_2021.2.185/deployment_tools/tools/post_training_optimization_toolkit/compression/pipeline/pipeline.py", line 57, in run
    result = self.collect_statistics_and_run(model, current_algo_seq)
  File "/opt/intel/openvino_2021.2.185/deployment_tools/tools/post_training_optimization_toolkit/compression/pipeline/pipeline.py", line 67, in collect_statistics_and_run
    model = algo.run(model)
  File "/opt/intel/openvino_2021.2.185/deployment_tools/tools/post_training_optimization_toolkit/compression/algorithms/quantization/default/algorithm.py", line 74, in run
    self.algorithms[1].algo_collector.compute_statistics(model)
  File "/opt/intel/openvino_2021.2.185/deployment_tools/tools/post_training_optimization_toolkit/compression/statistics/collector.py", line 73, in compute_statistics
    _, stats_ = self._engine.predict(combined_stats, sampler)
  File "/opt/intel/openvino_2021.2.185/deployment_tools/tools/post_training_optimization_toolkit/compression/engines/ac_engine.py", line 169, in predict
    stdout_redirect(self._model_evaluator.process_dataset_async, **args)
  File "/opt/intel/openvino_2021.2.185/deployment_tools/tools/post_training_optimization_toolkit/compression/utils/logger.py", line 132, in stdout_redirect
    res = fn(*args, **kwargs)
  File "/opt/intel/openvino_2021.2.185/deployment_tools/tools/post_training_optimization_toolkit/libs/open_model_zoo/tools/accuracy_checker/accuracy_checker/evaluators/quantization_model_evaluator.py", line 153, in process_dataset_async
    batch_raw_predictions, batch_identifiers, batch_meta
  File "/opt/intel/openvino_2021.2.185/deployment_tools/tools/post_training_optimization_toolkit/libs/open_model_zoo/tools/accuracy_checker/accuracy_checker/evaluators/quantization_model_evaluator.py", line 99, in _process_ready_predictions
    return self.adapter.process(batch_raw_predictions, batch_identifiers, batch_meta)
  File "/opt/intel/openvino_2021.2.185/deployment_tools/tools/post_training_optimization_toolkit/libs/open_model_zoo/tools/accuracy_checker/accuracy_checker/adapters/detection.py", line 84, in process
    valid_classes = classes[:num_detections]
TypeError: only integer scalar arrays can be converted to a scalar index
0 Kudos
1 Solution
IntelSupport
Community Manager
259 Views

Hi Akshya,

I am sorry for the delay in replying to you. The error message that you got might be related to your model since you retrained the model. Did you get the same error with the original model? Moreover, since you are using the Object Detection API model, then you must follow the below instructions to convert the model and follow all the parameters needed.

https://docs.openvinotoolkit.org/latest/openvino_docs_MO_DG_prepare_model_convert_model_tf_specific_...

 

Regards,

Aznie

 

View solution in original post

4 Replies
IntelSupport
Community Manager
294 Views

 

Hi Akshya,

We are investigating this issue and will get back to you at the earliest. Can you please share your system environment for us to duplicate this on our machine?

 

Regards,

Aznie


akshya
Employee
292 Views

Hi Aznie,

Thanks for the reply,  Here I am attaching the details of my system environment.

ubuntu 18.04.5 LTS(EC2 instance t2.large)
Processor: Intel® Xeon(R) CPU E5-2686 v4 @ 2.30GHz × 2
OS type: 64-bit
OpenVINO Release: 2021.2

Regards,

Akshya

IntelSupport
Community Manager
260 Views

Hi Akshya,

I am sorry for the delay in replying to you. The error message that you got might be related to your model since you retrained the model. Did you get the same error with the original model? Moreover, since you are using the Object Detection API model, then you must follow the below instructions to convert the model and follow all the parameters needed.

https://docs.openvinotoolkit.org/latest/openvino_docs_MO_DG_prepare_model_convert_model_tf_specific_...

 

Regards,

Aznie

 

View solution in original post

IntelSupport
Community Manager
218 Views

Hi Akshya,

This thread will no longer be monitored since this issue has been resolved. If you need any additional information from Intel, please submit a new question.


Regards,

Aznie


Reply