Closed podestplatz closed 4 years ago
Hey! You should be able to specify devices like this:
interpreter_1 = Interpreter(model_1_path,
experimental_delegates=[load_delegate('libedgetpu.so.1', {"device": "pci:0"})])
interpreter_2 = Interpreter(model_2_path,
experimental_delegates=[load_delegate('libedgetpu.so.1', {"device": "usb:0"})])
FYI: We don't have an API to list all devices with the tflite API, but with edgetpu API, you can list devices like this:
from edgetpu.basic import edgetpu_utils
edge_tpus = edgetpu_utils.ListEdgeTpuPaths(
edgetpu_utils.EDGE_TPU_STATE_UNASSIGNED)
print(edge_tpus)
Which shoulg give you something like this:
('/dev/apex_0', '/sys/bus/usb/devices/2-1')
Hey @Namburger,
thank you very much! I will check it. Just out of curiosity: in "pci:0"
and "usb:0"
what meaning does the 0
have?
Another question: do you have a documentation on parameters the edgetpu library (libedgetpu.so.1) accepts when loaded as delegate? Because I didn't find something like that?
@podestplatz sorry, should have left you the link to our docs: https://coral.ai/docs/edgetpu/multiple-edgetpu/#using-the-tensorflow-lite-python-api
Basically if you have more than one usb devices, it'll index like this usb:0
and usb:1
, for me on the dev board, the edgetpu is registered as a pic device, so it's registered as pci:0
Ok I understand, quite obvious actually ^^ Thank you very much!
Hi,
I am working with both the Coral EdgeTPU USB and PCIe accelerators. In the python detection demo the following function is responsible for creating an interpreter object.
Line 7 is of especial interest to me, since I would like to be able to specify the device that shall be used, instead of relying on the automatic selection that is done by
libedgetpu.so.1
. From reading the code, it should be possible to select a device simply by appending@<device-selector>
to the path of the model file. My problem now is that I can't figure out the<device-selector>
. I tried the following options:enum edgetpu_device_type
:edgetpu_c.h/sys/bus/usb/devices/<corresponding usb-device>
,/dev/apex_0
With every of these values I get the following error message:
My system runs Ubuntu 20.04 server with the PCIe accelerator built into its housing, thus simply unplugging it and attaching the USB accelerator would be no option.
Thanks in advance for your help!
Chees, podestplatz