I trying to use tflite delegate in python, but whenever my code tries to initialize the interpreter using code:
lib_path = '/usr/lib/libQnnTFLiteDelegate.so'
delegate = tf.lite.experimental.load_delegate(lib_path, options={'backend_type': 'htp'})
interpreter = tf.lite.Interpreter(model_content=tflite_model, experimental_delegates=[delegate])
it throws error as interpreter tries to get initialized. The error:
<W> Initializing HtpProvider
<W> Specified config SOC, ignoring on real target
<E> createUnsignedPD unsigned PD or DSPRPC_GET_DSP_INFO not supported by HTP
<E> DspTransport.openSession qnn_open failed, 0x00000072, prio 100
<E> DspTransport.getHandle failed, error 0x00000007
<E> createDspTransportInstance failed to config transport object
<E> error in creation of transport instance
<W> Failed to create transport instance: 1002
<E> Failed to create transport for device, error: 1002
<E> Failed to load skel, error: 1002
<E> Transport layer setup failed: 14001
<E> Failed to parse default platform info: 14001
<E> Failed to load default platform info: 14001
<E> Failed to parse platform config: 14001
Traceback (most recent call last):
File "/home/user/tflite delegate/test.py", line 35, in <module>
interpreter = tf.lite.Interpreter(
File "/home/user/env_py310/lib/python3.10/site-packages/tensorflow/lite/python/interpreter.py", line 495, in __init__
self._interpreter.ModifyGraphWithDelegate(
RuntimeError: Restored original execution plan after delegate application failure.
I have tried write the code inspired from this in the github issue, but it didn’t work. I have tried multiple tflite model exported for qcs6490 as well as the model provided in the github issue which might worked on some other sbc having qcs6490 as mentioned in the github issue.
Please help me fix this. Or let me know if there is any proper documentation to use tflite delegate in python to run tflite models on NPU / HTP.