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.

KEY_CPU_THREADS_NUM in Python API

levchik__anatoly
Beginner
1,891 Views

I'm trying to set KEY_CPU_THREADS_NUM for Python API.

For this fragment:

plugin = IEPlugin(device='CPU')
exec_net = plugin.load(network=net, config={
    'KEY_CPU_THREADS_NUM': '1',
})

i'm getting:

  File "ie_api.pyx", line 85, in openvino.inference_engine.ie_api.IECore.load_network
  File "ie_api.pyx", line 92, in openvino.inference_engine.ie_api.IECore.load_network
RuntimeError: [NOT_FOUND] Unsupported property KEY_CPU_THREADS_NUM by CPU plugin

Same error i'm getting for:

ie = IECore()
exec_net = ie.load_network(network=net, device_name='CPU', config={
    'KEY_CPU_THREADS_NUM': '1',
})

How set custom KEY_CPU_THREADS_NUM for python api? Maybe not with python but with env vars?

0 Kudos
1 Reply
JesusE_Intel
Moderator
1,890 Views

Hi Anatoly,

Could you try using the set_config function from the IECore to specify the CPU_THREADS_NUM? I ran the Hello_Query_Device sample to see available configuration parameters and it looks like the parameter name has changed from KEY_CPU_THREADS_NUM to CPU_THREADS_NUM.

Use this code snip to set the parameter and display the parameter value.

ie.set_config({"CPU_THREADS_NUM" : "1"}, "CPU")
print(ie.get_config("CPU", "CPU_THREADS_NUM"))

Please let me know if this answers your question.

Regards,

Jesus

0 Kudos
Reply