edgetpu: Failed to load delegate from libedgetpu.so.1 M.2 Accelerator with Dual Edge TPU
Description
The image classifier test from https://www.coral.ai/docs/m2/get-started/ fails. I had this coral device installed and working in Frigate for months before it quit.
Hi @techniemer! Could you follow these things and let us know.
- Ensure the Coral device is plugged in while inference is happening.
- Check the permissions on your /dev/apex_0 device.
- Add the user to plugdev group.
Attached issues 1 and 2 with similar error stack trace for reference.
Please post on Coral Edge Tpu support for further assistance. Thank you!
_Originally posted by @mohantym in https://github.com/tensorflow/tensorflow/issues/56451#issuecomment-1154858528_
- This is an M.2 TPU and it is connected.
- Permissions are 660, output below.
- Added the user to that group with the same end result.
Click to expand!
Issue Type
Support
Operating System
Linux
Coral Device
M.2 Accelerator with dual Edge TPU
Other Devices
No response
Programming Language
Python 3.9
Relevant Log Output
user@nvr:~/coral/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 "/usr/lib/python3/dist-packages/tflite_runtime/interpreter.py", line 160, in load_delegate
delegate = Delegate(library, options)
File "/usr/lib/python3/dist-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/user/coral/pycoral/examples/classify_image.py", line 121, in <module>
main()
File "/home/user/coral/pycoral/examples/classify_image.py", line 71, in main
interpreter = make_interpreter(*args.model.split('@'))
File "/usr/lib/python3/dist-packages/pycoral/utils/edgetpu.py", line 87, in make_interpreter
delegates = [load_edgetpu_delegate({'device': device} if device else {})]
File "/usr/lib/python3/dist-packages/pycoral/utils/edgetpu.py", line 52, in load_edgetpu_delegate
return tflite.load_delegate(_EDGETPU_SHARED_LIB, options or {})
File "/usr/lib/python3/dist-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
user@nvr:~/coral/pycoral$ ls /dev/apex_0
/dev/apex_0
user@nvr:/root$ lspci -nn | grep 089a
01:00.0 System peripheral [0880]: Global Unichip Corp. Coral Edge TPU [1ac1:089a]
root@nvr:~# dmesg | grep apex
[ 3.313709] apex 0000:01:00.0: enabling device (0100 -> 0102)
[ 3.314038] apex 0000:01:00.0: Couldn't initialize interrupts: -22
[ 8.471106] apex 0000:01:00.0: Apex performance not throttled due to temperature
root@nvr:~# dmesg | grep 089a
[ 0.315384] pci 0000:01:00.0: [1ac1:089a] type 00 class 0x0000ff
root@nvr:~# id user
uid=1000(user) gid=1000(user) groups=1000(user),24(cdrom),25(floppy),27(sudo),29(audio),30(dip),44(video),46(plugdev),107(render),109(netdev),1001(apex)
root@nvr:~# ls -l /dev/apex_0
crw-rw---- 1 root apex 120, 0 Jun 13 19:28 /dev/apex_0
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 21 (9 by maintainers)
That was it. I had
pci=nomsiin mygrub.cfgfile, removed that and all is well.