Part Number: TDA4VM
I am using BeagleBone AI-64 board which has TDA4VM processor. I am trying to confirm the DL acceleration on BeagleBone AI-64 with the following code provided in the Edge AI Webinar: "Hello World" Application.
tidl_delegate = [tflite.load_delegate(os.path.join(os.environ['TIDL_TOOLS_PATH'], 'tidl_model_import_tflite.so'), compile_options)]
While running the `3_EdgeAI_Model_Compile_Run.ipynb` having above code line giving error "RuntimeError: If delegate loading is used on unsupported platform". I am running BeagleBone AI-64 board with boot image Debian 11.x (Bullseye) TI EDGEAI Desktop.The full error log is as follows:
---------------------------------------------------------------------------
OSError Traceback (most recent call last)
Input In [3], in <cell line: 43>()
40 [os.remove(os.path.join(root, f)) for f in files]
41 [os.rmdir(os.path.join(root, d)) for d in dirs]
---> 43 tidl_delegate = [tflite.load_delegate(os.path.join(os.environ['TIDL_TOOLS_PATH'], 'tidl_model_import_tflite.so'), compile_options)]
45 # tidl_delegate = [tflite.load_delegate\
46 # ('/usr/lib/libtidl_tfl_delegate.so', delegate_options)]
48 interpreter = tflite.Interpreter(model_path=tflite_model_path, experimental_delegates=tidl_delegate)
File /usr/lib/python3/dist-packages/tflite_runtime/interpreter.py:152, in load_delegate(library, options)
134 """Returns loaded Delegate object.
135
136 Args:
(...)
149 RuntimeError: If delegate loading is used on unsupported platform.
150 """
151 try:
--> 152 delegate = Delegate(library, options)
153 except ValueError as e:
154 raise ValueError('Failed to load delegate from {}\n{}'.format(
155 library, str(e)))
File /usr/lib/python3/dist-packages/tflite_runtime/interpreter.py:81, in Delegate.__init__(self, library, options)
77 if platform.python_implementation() != 'CPython':
78 raise RuntimeError('Delegates are currently only supported into CPython'
79 'due to missing immediate reference counting.')
---> 81 self._library = ctypes.pydll.LoadLibrary(library)
82 self._library.tflite_plugin_create_delegate.argtypes = [
83 ctypes.POINTER(ctypes.c_char_p),
84 ctypes.POINTER(ctypes.c_char_p), ctypes.c_int,
85 ctypes.CFUNCTYPE(None, ctypes.c_char_p)
86 ]
87 self._library.tflite_plugin_create_delegate.restype = ctypes.c_void_p
File /usr/lib/python3.9/ctypes/__init__.py:452, in LibraryLoader.LoadLibrary(self, name)
451 def LoadLibrary(self, name):
--> 452 return self._dlltype(name)
File /usr/lib/python3.9/ctypes/__init__.py:374, in CDLL.__init__(self, name, mode, handle, use_errno, use_last_error, winmode)
371 self._FuncPtr = _FuncPtr
373 if handle is None:
--> 374 self._handle = _dlopen(self._name, mode)
375 else:
376 self._handle = handle
OSError: /root/tidl_tools/tidl_model_import_tflite.so: cannot open shared object file: No such file or directory
I crosschecked the file (tidl_model_import_tflite.so) is present under /root/tidl_tools directory on BeagleBone AI-64.
root@BeagleBone:~# ls -lht tidl_tools/ total 256M -rwxr-xr-x 1 root root 12M Sep 12 11:27 tidl_model_import_tflite.so -rwxr-xr-x 1 root root 79M Aug 30 12:47 PC_dsp_test_dl_algo.out -rw-r--r-- 1 root root 15K Aug 30 12:47 itidl_rt.h -rwxr-xr-x 1 root root 12M Aug 30 12:47 tidl_model_import_relay.so -rwxr-xr-x 1 root root 71M Aug 30 12:47 libvx_tidl_rt.so -rwxr-xr-x 1 root root 71M Aug 30 12:47 libvx_tidl_rt.so.1.0 -rwxr-xr-x 1 root root 38K Aug 30 12:47 libtidl_tfl_delegate.so -rwxr-xr-x 1 root root 162K Aug 30 12:47 tidl_graphVisualiser.out -rwxr-xr-x 1 root root 53K Aug 30 12:47 tidl_graphVisualiser_runtimes.out -rwxr-xr-x 1 root root 65K Aug 30 12:47 libtidl_onnxrt_EP.so -rwxr-xr-x 1 root root 12M Aug 30 12:47 tidl_model_import_onnx.so -rwxr-xr-x 1 root root 223K Aug 30 12:47 ti_cnnperfsim.out -rw-r--r-- 1 root root 591 Aug 30 12:47 device_config.cfg root@BeagleBone:~#
Does this file `tidl_model_import_tflite.so` from tidl_tools not supported on BeagleBone AI-64? How to get BeagleBone AI-64 supported file of same?
I am successful with model compilation using edgeai-tidl-tools repo. on my Ubuntu 18.04 PC for DEVICE = j7.
Thanks,
Vaibhav