google-coral / edgetpu

Coral issue tracker (and legacy Edge TPU API source)
https://coral.ai
Apache License 2.0
412 stars 124 forks source link

running coral code on Mac #763

Closed ilonadem closed 1 year ago

ilonadem commented 1 year ago

Description

Hi, I'm trying to test the models deployed by the coral on my Mac for benchmarking purposes. Is it possible to install+run the pycoral library on a Mac without the USB accelerator? I've followed the installation instructions as outlined by: https://coral.ai/docs/edgetpu/tflite-python/#inferencing-example and https://coral.ai/software/#pycoral-api, but the main error I get when trying to run the inferencing example in https://coral.ai/docs/edgetpu/tflite-python/#inferencing-example I get the following error:

Traceback (most recent call last):
  File "/Users/ilonademler/miniconda3/lib/python3.8/site-packages/tflite_runtime/interpreter.py", line 160, in load_delegate
    delegate = Delegate(library, options)
  File "/Users/ilonademler/miniconda3/lib/python3.8/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 "/Users/ilonademler/Documents/Harvard/seniorfall/coral/test_script.py", line 18, in <module>
    experimental_delegates=[tflite.load_delegate('libedgetpu.1.dylib')])
  File "/Users/ilonademler/miniconda3/lib/python3.8/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.1.dylib
Click to expand! ### Issue Type Build/Install ### Operating System Mac OS ### Coral Device _No response_ ### Other Devices _No response_ ### Programming Language _No response_ ### Relevant Log Output ```shell Traceback (most recent call last): File "/Users/ilonademler/miniconda3/lib/python3.8/site-packages/tflite_runtime/interpreter.py", line 160, in load_delegate delegate = Delegate(library, options) File "/Users/ilonademler/miniconda3/lib/python3.8/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 "/Users/ilonademler/Documents/Harvard/seniorfall/coral/test_script.py", line 18, in experimental_delegates=[tflite.load_delegate('libedgetpu.1.dylib')]) File "/Users/ilonademler/miniconda3/lib/python3.8/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.1.dylib ```
easy-and-simple commented 1 year ago

What means to run it without USB accelerator? How to load runtime if there is no device to run it on? Software runs only on hardware. What is the sense to run it if there is no device connected?

hjonnala commented 1 year ago

Is it possible to install+run the pycoral library on a Mac without the USB accelerator?

To use pycoral API without USB accelerator for uncompiled tflite models, please change interpreter with https://github.com/hjonnala/snippets/blob/main/coral_inference.py#L27.

You won't be able to test the EdgeTPU models without the Coral Device. Thanks!!

google-coral-bot[bot] commented 1 year ago

Are you satisfied with the resolution of your issue? Yes No