Closed VelizarVESSELINOV closed 2 years ago
Hi, Have you installed edgetpu runtime https://coral.ai/docs/accelerator/get-started#runtime-on-mac.
can you please paste the output of below commnad:
python3 -c 'from pycoral.utils.edgetpu import get_runtime_version; print(get_runtime_version())'
Hi, @VelizarVESSELINOV were you able to run the demo?
I have the same issue . Followed the instructions and get the same error. I tried the python 3 command and all I get is File "string ", line 1 from pycoral.utils.edgetpu import SyntaxError: invalid syntax
@cku239 if you are trying the code in file try this:
from pycoral.utils.edgetpu import get_runtime_version
print(get_runtime_version())
Hi, @VelizarVESSELINOV were you able to run the demo?
I am getting the same error. Is this because homebrew (on M1)is installing the libusb library in /opt/homebrew/opt/libusb/lib but the code is using the old way of doing things '/opt/local/lib/'.
Bit new to MacOS so not sure what is best way to set this to look for correct path (assuming that is the problem).
(CoralAcc) brian@Brians-Air pycoral % python3 examples/classify_image.py \ --model test_data/mobilenet_v2_1.0_224_inat_bird_quant_edgetpu.tflite \ --labels test_data/inat_bird_labels.txt \ --input test_data/parrot.jpg Traceback (most recent call last): File "examples/classify_image.py", line 40, in <module> from pycoral.utils.edgetpu import make_interpreter File "/Users/brian/opt/anaconda3/envs/CoralAcc/lib/python3.8/site-packages/pycoral/utils/edgetpu.py", line 24, in <module> from pycoral.pybind._pywrap_coral import GetRuntimeVersion as get_runtime_version ImportError: dlopen(/Users/brian/opt/anaconda3/envs/CoralAcc/lib/python3.8/site-packages/pycoral/pybind/_pywrap_coral.cpython-38-darwin.so, 2): Library not loaded: /opt/local/lib/libusb-1.0.0.dylib Referenced from: /usr/local/lib/libedgetpu.1.dylib Reason: image not found
@cku239 have you installed edgetpu runtime?
can you please paste the output of this command:
python3 -c 'from pycoral.utils.edgetpu import get_runtime_version; print(get_runtime_version())'
Python 3.9.7 (default, Sep 3 2021, 06:18:44)
[GCC 10.2.1 20210110] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from pycoral.utils.edgetpu import get_runtime_version; print(get_runtime_version())
BuildLabel(COMPILER=6.3.0 20170516,DATE=redacted,TIME=redacted), RuntimeVersion(14)
>>>
and which coral device are you trying to use?
I'm trying to get USB accelerator version to work.
How would I know if the runtime has been installed? I've followed the instructions and got no errors until running the test at end of the instructions. I ran the instructions to install edgetpu got the message about whether the USB accelarator should run outside its operating temp. I have two folders libedgetpu and libedgetpu_bin
This is what I get from running that command:-
from pycoral.utils.edgetpu import get_runtime_version; print(get_runtime_version()) Traceback (most recent call last): File "
", line 1, in File "/Users/brian/coral/pycoral/pycoral/utils/edgetpu.py", line 24, in from pycoral.pybind._pywrap_coral import GetRuntimeVersion as get_runtime_version ModuleNotFoundError: No module named 'pycoral.pybind'
Have you installed pycoral? can you please attach pip freeze
output in text file.
Please try these commands on terminal and paste the output here:
python3 -c "from ctypes.util import find_library; print(find_library(\"edgetpu\"))"
After connecting USB accelerator:
lsusb -d 1a6e:089a
I tried reinstalling everything to make sure didn't make a mistake. Saw this message "Installing Edge TPU runtime library [/usr/local/lib]... Installing Edge TPU runtime library symlink [/usr/local/lib]..."
(CoralAcc) brian@Brians-Air ~ % python3 -c "from ctypes.util import find_library; print(find_library(\"edgetpu\"))" None (CoralAcc) brian@Brians-Air ~ %
lsusb output:-
(CoralAcc) brian@Brians-Air ~ % lsusb -d 1a6e:089a
(CoralAcc) brian@Brians-Air ~ %
output of pip freeze:- pipfreezeoutput.txt
similar to this python3 -c "from ctypes.util import find_library; print(find_library("edgetpu"))"
can you paste the output of this command
python3 -c "from pycoral.utils.edgetpu import get_runtime_version; print(get_runtime_version())"
from pycoral.utils.edgetpu import get_runtime_version; print(get_runtime_version()) Traceback (most recent call last): File "", line 1, in File "/Users/brian/coral/pycoral/pycoral/utils/edgetpu.py", line 24, in from pycoral.pybind._pywrap_coral import GetRuntimeVersion as get_runtime_version ModuleNotFoundError: No module named 'pycoral.pybind'
you will get this error if you are trying inside coral/pycoral
directory. please try outside of it.
(base) brian@Brians-Air edgetpu_runtime % python3 -c "from ctypes.util import find_library; print(find_library("edgetpu"))"
Traceback (most recent call last):
File "
(base) brian@Brians-Air edgetpu_runtime % python3 -c "from pycoral.utils.edgetpu import get_runtime_version; print(get_runtime_version())"
Traceback (most recent call last):
File "
btw on the Mac M1 homebrew puts /opt/local/lib/libusb-1.0.0.dylib into /opt/homebrew/opt/libusb-1.0.0.dylib.
can you try coping /opt/homebrew/opt/libusb-1.0.0.dylib
and /opt/homebrew/opt/libusb-1.dylib
to /opt/local/lib/
@cku239 does your issue got resolved?
Feel free to reopen if issue still persists.
Error
Install
Following the instructions: https://coral.ai/docs/accelerator/get-started
libusb 1.0.24 already installed