DAVIDNYARKO123 / edge-tpu-silva

Streamlining the process for seamless execution of PyCoral in running TensorFlow Lite models on an Edge TPU USB.
https://pypi.org/project/edge-tpu-silva/
25 stars 3 forks source link

Failed to load delegate from libedgetpu.so.1 #5

Open Demonytro opened 6 months ago

Demonytro commented 6 months ago

(.venv) rpi5@raspberrypi:~/silva $ silvatpu -p det -m 240_yolov8n_full_integer_quant_edgetpu.tflite -i Working_Man_7.mp4 -z 192 -t 0.5 Loading 240_yolov8n_full_integer_quant_edgetpu.tflite for TensorFlow Lite Edge TPU inference... Traceback (most recent call last): File "/home/rpi5/silva/.venv/lib/python3.9/site-packages/tflite_runtime/interpreter.py", line 160, in load_delegate delegate = Delegate(library, options) File "/home/rpi5/silva/.venv/lib/python3.9/site-packages/tflite_runtime/interpreter.py", line 119, in init raise ValueError(capture.message) ValueError

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/home/rpi5/silva/.venv/bin/silvatpu", line 8, in sys.exit(silvatpu()) File "/home/rpi5/silva/.venv/lib/python3.9/site-packages/edge_tpusilva/main.py", line 97, in silvatpu for , _ in outs: File "/home/rpi5/silva/.venv/lib/python3.9/site-packages/edge_tpu_silva/silva/silva_detect.py", line 38, in process_detection outs = model.predict( File "/home/rpi5/silva/.venv/lib/python3.9/site-packages/ultralytics/engine/model.py", line 446, in predict self.predictor.setup_model(model=self.model, verbose=is_cli) File "/home/rpi5/silva/.venv/lib/python3.9/site-packages/ultralytics/engine/predictor.py", line 297, in setup_model self.model = AutoBackend( File "/home/rpi5/silva/.venv/lib/python3.9/site-packages/torch/utils/_contextlib.py", line 115, in decorate_context return func(*args, **kwargs) File "/home/rpi5/silva/.venv/lib/python3.9/site-packages/ultralytics/nn/autobackend.py", line 337, in init interpreter = Interpreter(model_path=w, experimental_delegates=[load_delegate(delegate)]) File "/home/rpi5/silva/.venv/lib/python3.9/site-packages/tflite_runtime/interpreter.py", line 162, in load_delegate raise ValueError('Failed to load delegate from {}\n{}'.format( ValueError: Failed to load delegate from libedgetpu.so.1

(.venv) rpi5@raspberrypi:~/silva $

stefcarpi commented 6 months ago

Hi! After some problems in configuring the coral on a raspberrypi4 I tried your package @DAVIDNYARKO123 , to install all dependencies and run a model. I'm running python 3.9, and I'm using the process_detection function, but I get the same error as @Demonytro

Loading ../240_yolov8n_full_integer_quant_edgetpu.tflite for TensorFlow Lite Edge TPU inferen\ ce...
Traceback (most recent call last):
File "/home/pi/.pyenvs/silva/lib/python3.9/site-packages/tflite_runtime/interpreter.py", li\ ne 160, in load_delegate
delegate = Delegate(library, options)
File "/home/pi/.pyenvs/silva/lib/python3.9/site-packages/tflite_runtime/interpreter.py", li\ ne 119, in init
raise ValueError(capture.message)
ValueError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "", line 17, in __PYTHON_ELeval
File "/home/pi/traxer-testing/silvaprocess.py", line 9, in
for
, _ in outs:
File "/home/pi/.pyenvs/silva/lib/python3.9/site-packages/edge_tpu_silva/silva/silva_detect.\ py", line 38, in process_detection
outs = model.predict(
File "/home/pi/.pyenvs/silva/lib/python3.9/site-packages/ultralytics/engine/model.py", line\ 446, in predict
self.predictor.setup_model(model=self.model, verbose=is_cli)
File "/home/pi/.pyenvs/silva/lib/python3.9/site-packages/ultralytics/engine/predictor.py", \ line 297, in setup_model
self.model = AutoBackend(
File "/home/pi/.pyenvs/silva/lib/python3.9/site-packages/torch/utils/_contextlib.py", line \ 115, in decorate_context
return func(*args, **kwargs)
File "/home/pi/.pyenvs/silva/lib/python3.9/site-packages/ultralytics/nn/autobackend.py", li\ ne 337, in init
interpreter = Interpreter(model_path=w, experimental_delegates=[load_delegate(delegate)]) File "/home/pi/.pyenvs/silva/lib/python3.9/site-packages/tflite_runtime/interpreter.py", li\ ne 162, in load_delegate
raise ValueError('Failed to load delegate from {}\n{}'.format(
ValueError: Failed to load delegate from libedgetpu.so.1

holmesha commented 5 months ago

getting the same error...cannot make this work using a live feed instead of an uploaded file...it was the freaking cord...

NUB-DISTRAIT commented 5 months ago

Hi! After some problems in configuring the coral on a raspberrypi4 I tried your package @DAVIDNYARKO123 , to install all dependencies and run a model. I'm running python 3.9, and I'm using the process_detection function, but I get the same error as @Demonytro

Loading ../240_yolov8n_full_integer_quant_edgetpu.tflite for TensorFlow Lite Edge TPU inferen\ ce...
Traceback (most recent call last):
File "/home/pi/.pyenvs/silva/lib/python3.9/site-packages/tflite_runtime/interpreter.py", li\ ne 160, in load_delegate
delegate = Delegate(library, options)
File "/home/pi/.pyenvs/silva/lib/python3.9/site-packages/tflite_runtime/interpreter.py", li\ ne 119, in init
raise ValueError(capture.message)
ValueError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "", line 17, in __PYTHON_ELeval
File "/home/pi/traxer-testing/silvaprocess.py", line 9, in
for
, _ in outs:
File "/home/pi/.pyenvs/silva/lib/python3.9/site-packages/edge_tpu_silva/silva/silva_detect.\ py", line 38, in process_detection
outs = model.predict(
File "/home/pi/.pyenvs/silva/lib/python3.9/site-packages/ultralytics/engine/model.py", line\ 446, in predict
self.predictor.setup_model(model=self.model, verbose=is_cli)
File "/home/pi/.pyenvs/silva/lib/python3.9/site-packages/ultralytics/engine/predictor.py", \ line 297, in setup_model
self.model = AutoBackend(
File "/home/pi/.pyenvs/silva/lib/python3.9/site-packages/torch/utils/_contextlib.py", line \ 115, in decorate_context
return func(*args, **kwargs)
File "/home/pi/.pyenvs/silva/lib/python3.9/site-packages/ultralytics/nn/autobackend.py", li\ ne 337, in init
interpreter = Interpreter(model_path=w, experimental_delegates=[load_delegate(delegate)]) File "/home/pi/.pyenvs/silva/lib/python3.9/site-packages/tflite_runtime/interpreter.py", li\ ne 162, in load_delegate
raise ValueError('Failed to load delegate from {}\n{}'.format(
ValueError: Failed to load delegate from libedgetpu.so.1

Same issue "ValueError: Failed to load delegate from libedgetpu.so.1" encountered. @DAVIDNYARKO123 Kindly guide us through.

NUB-DISTRAIT commented 5 months ago

Found it: https://github.com/DAVIDNYARKO123/edge-tpu-silva/issues/3