TexasInstruments / edgeai-tidl-tools

Edgeai TIDL Tools and Examples - This repository contains Tools and example developed for Deep learning runtime (DLRT) offering provided by TI’s edge AI solutions.
Other
121 stars 27 forks source link

could not load library libvx_tidl_rt.so #48

Closed niru-5 closed 1 year ago

niru-5 commented 1 year ago

Hi,

We are using docker environment suggestions from the dockerfile and also made sure we have python3.6 However, when we run the tfl python example, we get the following error ->

Running 3 Models - ['cl-tfl-mobilenet_v1_1.0_224', 'ss-tfl-deeplabv3_mnv2_ade20k_float', 'od-tfl-ssd_mobilenet_v2_300_float']

Running_Model :  cl-tfl-mobilenet_v1_1.0_224

Running_Model :  ss-tfl-deeplabv3_mnv2_ade20k_float

Running_Model :  od-tfl-ssd_mobilenet_v2_300_float
Process Process-3:
Process Process-1:
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/tflite_runtime/interpreter.py", line 175, in load_delegate
    delegate = Delegate(library, options)
  File "/usr/local/lib/python3.6/dist-packages/tflite_runtime/interpreter.py", line 113, in __init__
    raise ValueError(capture.message)
ValueError: could not load library libvx_tidl_rt.so

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.6/multiprocessing/process.py", line 258, in _bootstrap
    self.run()
  File "/usr/lib/python3.6/multiprocessing/process.py", line 93, in run
    self._target(*self._args, **self._kwargs)
  File "tflrt_delegate.py", line 174, in run_model
    experimental_delegates=[tflite.load_delegate(os.path.join(tidl_tools_path, 'tidl_model_import_tflite.so'), delegate_options)])
  File "/usr/local/lib/python3.6/dist-packages/tflite_runtime/interpreter.py", line 178, in load_delegate
    library, str(e)))
ValueError: Failed to load delegate from /resources/edgeai-tidl-tools/tidl_tools/tidl_model_import_tflite.so
could not load library libvx_tidl_rt.so
Process Process-2:
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/tflite_runtime/interpreter.py", line 175, in load_delegate
    delegate = Delegate(library, options)
  File "/usr/local/lib/python3.6/dist-packages/tflite_runtime/interpreter.py", line 113, in __init__
    raise ValueError(capture.message)
ValueError: could not load library libvx_tidl_rt.so

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.6/multiprocessing/process.py", line 258, in _bootstrap
    self.run()
  File "/usr/lib/python3.6/multiprocessing/process.py", line 93, in run
    self._target(*self._args, **self._kwargs)
  File "tflrt_delegate.py", line 174, in run_model
    experimental_delegates=[tflite.load_delegate(os.path.join(tidl_tools_path, 'tidl_model_import_tflite.so'), delegate_options)])
  File "/usr/local/lib/python3.6/dist-packages/tflite_runtime/interpreter.py", line 178, in load_delegate
    library, str(e)))
ValueError: Failed to load delegate from /resources/edgeai-tidl-tools/tidl_tools/tidl_model_import_tflite.so
could not load library libvx_tidl_rt.so
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/tflite_runtime/interpreter.py", line 175, in load_delegate
    delegate = Delegate(library, options)
  File "/usr/local/lib/python3.6/dist-packages/tflite_runtime/interpreter.py", line 113, in __init__
    raise ValueError(capture.message)
ValueError: could not load library libvx_tidl_rt.so

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.6/multiprocessing/process.py", line 258, in _bootstrap
    self.run()
  File "/usr/lib/python3.6/multiprocessing/process.py", line 93, in run
    self._target(*self._args, **self._kwargs)
  File "tflrt_delegate.py", line 174, in run_model
    experimental_delegates=[tflite.load_delegate(os.path.join(tidl_tools_path, 'tidl_model_import_tflite.so'), delegate_options)])
  File "/usr/local/lib/python3.6/dist-packages/tflite_runtime/interpreter.py", line 178, in load_delegate
    library, str(e)))
ValueError: Failed to load delegate from /resources/edgeai-tidl-tools/tidl_tools/tidl_model_import_tflite.so
could not load library libvx_tidl_rt.so
^CTraceback (most recent call last):
  File "tflrt_delegate.py", line 257, in <module>
    nthreads = join_one(nthreads)
  File "tflrt_delegate.py", line 239, in join_one
    sem.acquire()

However, we have checked that the TIDL_TOOLS_PATH is set and has the necessary libs.

ls ${TIDL_TOOLS_PATH}
device_config.cfg        libvx_tidl_rt.so         tidl_graphVisualiser.out           tidl_model_import.so
itidl_rt.h               libvx_tidl_rt.so.1.0     tidl_graphVisualiser_runtimes.out  tidl_model_import_tflite.so
itvm_rt.h                osrt_deps                tidl_model_import_onnx.so          yaml-cpp
libtidl_onnxrt_EP.so     PC_dsp_test_dl_algo.out  tidl_model_import.out
libtidl_tfl_delegate.so  ti_cnnperfsim.out        tidl_model_import_relay.so

Is there anything more we can do to debug the issue?

Thank You Niranjan

GesilaA commented 1 year ago

You may need to run commands below

export DEVICE=j7
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$TIDL_TOOLS_PATH:$TIDL_TOOLS_PATH/osrt_deps
niru-5 commented 1 year ago

Hi,

That did solve the problem.

Thanks, Niranjan