snowzach / doods

DOODS - Dedicated Open Object Detection Service
MIT License
304 stars 31 forks source link

Coral EdgeTPU dev board #14

Closed bastienvans closed 3 years ago

bastienvans commented 4 years ago

Hello,

I've installed doods on my EdgeTPU dev board hoping it would make use of its HWAccel but it doesn't detect it.

ERROR detector/detector.go:73 Could not initialize detector edgetpu: no edgetpu devices detected {"package": "detector"}

Any help will be greatly appreciated!

Thanks

snowzach commented 4 years ago

Do you have it running in docker? Did you install the edge TPU drivers?

bastienvans commented 4 years ago

Do you have it running in docker? Did you install the edge TPU drivers?

Yes, I installed docker on the edge tpu. It installed fine.

I believe the drivers are installed by default on the Coral Board.

snowzach commented 4 years ago

Did you run docker with --device /dev/bus/usb giving access to the TPU?

bastienvans commented 4 years ago

Did you run docker with --device /dev/bus/usb giving access to the TPU?

I haven't tried this because I am not connecting a USB Coral. I have the Coral Dev board and I've installed your library on the board itself. I am not using a raspberry pi or similar.

Cheers

snowzach commented 4 years ago

Try running it with --device /dev/bus/usb anyhow and see if that works. You have to figure out where the device is exposed under /dev and pass that to the docker container.

bastienvans commented 4 years ago

This is the output.

mendel@coy-zebra:~/doods$ sudo docker run -it -v ~/doods/models:/opt/doods/models -v ~/doods/example.yaml:/opt/doods/config.yaml --device /dev/bus/usb -p 8080:8080 snowzach/doods:latest
2020-04-26T10:41:21.769Z    INFO    detector/detector.go:78 Configured Detector {"package": "detector", "name": "default", "type": "tflite", "model": "models/coco_ssd_mobilenet_v1_1.0_quant.tflite", "labels": 80, "width": 300, "height": 300}
2020-04-26T10:41:21.782Z    ERROR   detector/detector.go:73 Could not initialize detector edgetpu: no edgetpu devices detected  {"package": "detector"}
2020-04-26T10:41:23.292Z    INFO    detector/detector.go:78 Configured Detector {"package": "detector", "name": "tensorflow", "type": "tensorflow", "model": "models/faster_rcnn_inception_v2_coco_2018_01_28.pb", "labels": 65, "width": -1, "height": -1}

This is /dev:

apex_0         cpu_dma_latency  gpiochip0  i2c-1    loop0  loop-control      mmcblk0p2    net                 pts    ptyp7  ptypf      stderr  tty12  tty2   tty27  tty34  tty41  tty49  tty56  tty63    ttyp0  ttyp8  ttyS0     vcs1  vcsa1        vhci
autofs         cuse             gpiochip1  i2c-2    loop1  mapper            mmcblk0p3    network_latency     ptyp0  ptyp8  random     stdin   tty13  tty20  tty28  tty35  tty42  tty5   tty57  tty7     ttyp1  ttyp9  ttyS1     vcs2  vcsa2        video0
block          disk             gpiochip2  initctl  loop2  mem               mmcblk0rpmb  network_throughput  ptyp1  ptyp9  rtc        stdout  tty14  tty21  tty29  tty36  tty43  tty50  tty58  tty8     ttyp2  ttypa  ttyS2     vcs3  vcsa3        watchdog
btrfs-control  dri              gpiochip3  input    loop3  memory_bandwidth  mmcblk1      null                ptyp2  ptypa  rtc0       tty     tty15  tty22  tty3   tty37  tty44  tty51  tty59  tty9     ttyp3  ttypb  ttyS3     vcs4  vcsa4        watchdog0
bus            fd               gpiochip4  ion      loop4  mmcblk0           mmcblk1p1    port                ptyp3  ptypb  shm        tty0    tty16  tty23  tty30  tty38  tty45  tty52  tty6   ttyGS0   ttyp4  ttypc  ubi_ctrl  vcs5  vcsa5        zero
cec0           full             hugepages  kmsg     loop5  mmcblk0boot0      mmcblk1p2    pps0                ptyp4  ptypc  snd        tty1    tty17  tty24  tty31  tty39  tty46  tty53  tty60  ttymxc0  ttyp5  ttypd  urandom   vcs6  vcsa6
char           fuse             hwrng      kvm      loop6  mmcblk0boot1      mqueue       ptmx                ptyp5  ptypd  spidev0.0  tty10   tty18  tty25  tty32  tty4   tty47  tty54  tty61  ttymxc1  ttyp6  ttype  v4l       vcs7  vcsa7
console        galcore          i2c-0      log      loop7  mmcblk0p1         mxc_hantro   ptp0                ptyp6  ptype  spidev0.1  tty11   tty19  tty26  tty33  tty40  tty48  tty55  tty62  ttymxc2  ttyp7  ttypf  vcs       vcsa  vga_arbiter
snowzach commented 4 years ago

Does it say anything when you run lsusb do you see the edgeTPU? I know it has issues with power sometimes.

presslab-us commented 4 years ago

I believe /dev/apex_0 is the PCIe based Coral. Try passing that into Docker.

bastienvans commented 4 years ago

I believe /dev/apex_0 is the PCIe based Coral. Try passing that into Docker.

This worked, thank you so much! Consider adding it to the docs/wiki! 👍

runningman84 commented 3 years ago

How stable is the coral pcie device?

presslab-us commented 3 years ago

@runningman84 I have no issues. I had stability issues with the USB device when I would pass it into a VM. The Coral PCIe works great with VFIO passthrough into the VM.

snowzach commented 3 years ago

Closing