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
129 stars 33 forks source link

ValueError: could not load library libvx_tidl_rt.so #16

Closed lcc815 closed 2 years ago

lcc815 commented 2 years ago

Hi,

I have compiled the dockerfile and run the setup.py. it seems everything goes well, and i get these libraries in ./tidl_tools dir: PC_dsp_test_dl_algo.out libonnxruntime.so libtidl_onnxrt_EP.so libvx_tidl_rt.so.1.0 tidl_graphVisualiser_runtimes.out tidl_model_import_tflite.so device_config.cfg libonnxruntime.so.1.7.0 libtidl_tfl_delegate.so ti_cnnperfsim.out tidl_model_import_onnx.so itidl_rt.h libtensorflow-lite.a libvx_tidl_rt.so tidl_graphVisualiser.out tidl_model_import_relay.so

however, when i try to run ./scripts/run_python_examples.sh, an error was thrown as follows:

` X64 Architecture 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-2: Process Process-1: Traceback (most recent call last): File "/usr/local/lib/python3.6/dist-packages/tflite_runtime/interpreter.py", line 152, in load_delegate delegate = Delegate(library, options) File "/usr/local/lib/python3.6/dist-packages/tflite_runtime/interpreter.py", line 111, 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 149, 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 155, in load_delegate library, str(e))) ValueError: Failed to load delegate from /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 152, in load_delegate delegate = Delegate(library, options) File "/usr/local/lib/python3.6/dist-packages/tflite_runtime/interpreter.py", line 111, 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 149, 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 155, in load_delegate library, str(e))) ValueError: Failed to load delegate from /edgeai-tidl-tools/tidl_tools/tidl_model_import_tflite.so could not load library libvx_tidl_rt.so Process Process-3: Traceback (most recent call last): File "/usr/local/lib/python3.6/dist-packages/tflite_runtime/interpreter.py", line 152, in load_delegate delegate = Delegate(library, options) File "/usr/local/lib/python3.6/dist-packages/tflite_runtime/interpreter.py", line 111, in init raise ValueError(capture.message) ValueError: could not load library libvx_tidl_rt.so (many other similar information lines) `

is there anything i can do to fix this problem? thanks for your reply in advance.

lcc815 commented 2 years ago

Some additional information that may be useful

at the first time i run ./scripts/run_python_examples.sh, i got the following error: Traceback (most recent call last): File "tflrt_delegate.py", line 17, in <module> from common_utils import * File "/edgeai-tidl-tools/examples/osrt_python/common_utils.py", line 50, in <module> tidl_tools_path = os.environ["TIDL_TOOLS_PATH"] File "/usr/lib/python3.6/os.py", line 669, in __getitem__ raise KeyError(key) from None KeyError: 'TIDL_TOOLS_PATH' (many other similar information lines)

i solved this problem by changing the code from tidl_tools_path = os.environ["TIDL_TOOLS_PATH"] to tidl_tools_path = 'path_to_tidl_tools_dir'

kumardesappan commented 2 years ago

Did you invoke setup with below command (As described in readme)? If not, the setup script runs the commands in a new shell, so the env variables don’t get set in the parent terminal from which the script is run. source ./setup.sh