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

edgetpu runs only with root privileges?! #761

Open easy-and-simple opened 1 year ago

easy-and-simple commented 1 year ago

Description

edgetpu runs only with root privileges?! How to install it for user account? Docs also are not correct because install require root privileges on all commands not only where in example commands is used sudo

Click to expand! ### Issue Type Bug, Build/Install, Support, Documentation Bug ### Operating System Ubuntu ### Coral Device M.2 Accelerator A+E ### Other Devices _No response_ ### Programming Language Python 3.5, Python 3.6, Python 3.7, Python 3.8, Python 3.9 ### Relevant Log Output ```shell 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 "/home/rock/miniconda3/envs/yolo8/lib/python3.9/site-packages/tflite_runtime/interpreter.py", line 160, in load_delegate delegate = Delegate(library, options) File "/home/rock/miniconda3/envs/yolo8/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/rock/pycoral/examples/classify_image.py", line 121, in main() File "/home/rock/pycoral/examples/classify_image.py", line 71, in main interpreter = make_interpreter(*args.model.split('@')) File "/home/rock/miniconda3/envs/yolo8/lib/python3.9/site-packages/pycoral/utils/edgetpu.py", line 87, in make_interpreter delegates = [load_edgetpu_delegate({'device': device} if device else {})] File "/home/rock/miniconda3/envs/yolo8/lib/python3.9/site-packages/pycoral/utils/edgetpu.py", line 52, in load_edgetpu_delegate return tflite.load_delegate(_EDGETPU_SHARED_LIB, options or {}) File "/home/rock/miniconda3/envs/yolo8/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 ```
hjonnala commented 1 year ago

Hi @easy-and-simple have you tried add the user to apex group? https://coral.ai/docs/m2/get-started/#2a-on-linux

image