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

OpenVINO Python api "get_perf_counts()" does not return any results.

arakawa__yota
Beginner
460 Views

Hello,

I'm trying calculate inference time of IR models, and I used "get_perf_counts()" to get some informations about inference time.

I wrote the code like that

----------------------------

infer_request_handle = exec_net.start_async(request_id=0, inputs={input_blob: resize_img})
infer_request_handle.wait()
perf_counts = infer_request_handle.get_perf_counts()

log.info("Performance counters:")

print("{:<70} {:<15} {:<15} {:<15} {:<10}".format('name', 'layer_type', 'exet_type', 'status', 'real_time, us'))

for layer, stats in perf_counts.items():
    print("{:<70} {:<15} {:<15} {:<15} {:<10}".format(layer, stats['layer_type'], stats['exec_type'],
            stats['status'], stats['real_time']))

-----------------------------

but, I could not get result.

Next, I executed IntelSWTools\openvino_2019.1.087\deployment_tools\inference_engine\samples\python_samples\

   classification_sample_async\classification_sample_async argument --perf_counts True.

Also in this source code "get_perf_counts()" did not return a result.

Why does it not return a results?

0 Kudos
2 Replies
Shubha_R_Intel
Employee
461 Views

Dear arakawa, yota,

According to the documentation (see below) on Image Classification Python Sample Async you only pass in one of these -pc or --perf_counts but you don't need to put 'True'. Also don't forget, you always have to add the -l switch for Python samples which points it to the cpu_extension.dll (or *.so) if you are running on the CPU.

 https://docs.openvinotoolkit.org/latest/_inference_engine_ie_bridges_python_sample_classification_sample_async_README.html

Thanks,

Shubha

0 Kudos
Muthusamy__Suresh
461 Views

.

0 Kudos
Reply