Skip to content

Failed to load delegate from libedgetpu.so.1 on PCIe EdgeTPU [SOLVED] #35054

@asw-v4

Description

@asw-v4

Please make sure that this is a build/installation issue. As per our GitHub Policy, we only address code/doc bugs, performance issues, feature requests and build/installation issues on GitHub. tag:build_template

System information

  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04):
    ++ Linux Ubuntu 18.04.3
  • TensorFlow installed from (source or binary):
    ++ pip install tflite-runtime...whl
  • TensorFlow version:
    ++ tflite-runtime-1.14.0-cp37...
  • Python version:
    ++ 3.7.5
  • Installed using virtualenv? pip? conda?:
    ++ conda
  • CUDA/cuDNN version:
    ++ CPU Only with EdgeTPU
  • GPU model and memory:
    ++ PCIe EdgeTPU
Architecture:        x86_64
CPU op-mode(s):      32-bit, 64-bit
Byte Order:          Little Endian
CPU(s):              8
On-line CPU(s) list: 0-7
Thread(s) per core:  2
Core(s) per socket:  4
Socket(s):           1
NUMA node(s):        1
Vendor ID:           GenuineIntel
CPU family:          6
Model:               60
Model name:          Intel(R) Core(TM) i7-4700EQ CPU @ 2.40GHz
Stepping:            3
CPU MHz:             1097.578
CPU max MHz:         3400.0000
CPU min MHz:         800.0000
BogoMIPS:            4789.32
Virtualisation:      VT-x
L1d cache:           32K
L1i cache:           32K
L2 cache:            256K
L3 cache:            6144K
NUMA node0 CPU(s):   0-7
Flags:               fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer xsave avx f16c rdrand lahf_lm abm cpuid_fault epb invpcid_single pti ssbd ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid xsaveopt dtherm ida arat pln pts md_clear flush_l1d

Describe the problem

When running classify_image.py, I receive the following error

(Coral) v4@v4-TPU:~/coral/tflite/python/examples/classification$ python3 classify_image.py --model models/mobilenet_v2_1.0_224_inat_bird_quant_edgetpu.tflite --labels models/inat_bird_labels.txt --input images/parrot.jpg
Traceback (most recent call last):
  File "/home/v4/anaconda3/envs/Coral/lib/python3.7/site-packages/tflite_runtime/interpreter.py", line 165, in load_delegate
    delegate = Delegate(library, options)
  File "/home/v4/anaconda3/envs/Coral/lib/python3.7/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 "classify_image.py", line 118, in <module>
    main()
  File "classify_image.py", line 95, in main
    interpreter = make_interpreter(args.model)
  File "classify_image.py", line 69, in make_interpreter
    {'device': device[0]} if device else {})
  File "/home/v4/anaconda3/envs/Coral/lib/python3.7/site-packages/tflite_runtime/interpreter.py", line 168, in load_delegate
    library, str(e)))
ValueError: Failed to load delegate from libedgetpu.so.1

Any other info / logs
I have seen various solutions, suggesting I add the user to plugdev group (This was on a solution regarding the USB Accelerator, but i tried it anyway)

Another point was that it wasnt plugged in (again for the usb accelerator), which it is:

v4@v4-TPU:~$ ls /dev/apex_0
/dev/apex_0
v4@v4-TPU:~$ lspci -x | grep 089a
04:00.0 Non-VGA unclassified device: Device 1ac1:089a

And dmesg:

v4@v4-TPU:~$ dmesg | grep apex
[    7.830468] apex 0000:04:00.0: Apex performance not throttled due to temperature
v4@v4-TPU:~$ dmesg | grep 089a
[    0.274318] pci 0000:04:00.0: [1ac1:089a] type 00 class 0x0000ff

so the device is connected properly.

The Libraries are appropriately installed:

(Coral) v4@v4-TPU:~/coral/tflite/python/examples/classification$ ls /usr/lib/x86_64-linux-gnu/libedgetpu.so.1*
/usr/lib/x86_64-linux-gnu/libedgetpu.so.1  /usr/lib/x86_64-linux-gnu/libedgetpu.so.1.0

and these are the permissions of the libraries:

(Coral) v4@v4-TPU:~/coral/tflite/python/examples/classification$ ll /usr/lib/x86_64-linux-gnu/libedgetpu.so.1*
lrwxrwxrwx 1 root root     17 Sep 16 21:27 /usr/lib/x86_64-linux-gnu/libedgetpu.so.1 -> libedgetpu.so.1.0
-rwxr-xr-x 1 root root 956392 Sep 16 21:27 /usr/lib/x86_64-linux-gnu/libedgetpu.so.1.0

NOTE: I did have to add the 2nd and 3rd execute permissions on libedgetpu.so.1.0

Metadata

Metadata

Assignees

Labels

TF 1.14for issues seen with TF 1.14comp:liteTF Lite related issuestype:supportSupport issues

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions