|
| 1 | +--- |
| 2 | +layout: post |
| 3 | +title: Hands-on with Coral USB Accelerator (for Raspberry Pi) |
| 4 | +tags: |
| 5 | +- google |
| 6 | +- coral |
| 7 | +- tpu |
| 8 | +- raspberry pi |
| 9 | +published: true |
| 10 | +--- |
| 11 | + |
| 12 | +[Coral](https://coral.withgoogle.com/) launched [dev board](https://coral.withgoogle.com/products/dev-board/) and [usb accelerator](https://coral.withgoogle.com/products/accelerator/) a couple of weeks ago and they are now available on the store. |
| 13 | + |
| 14 | +I though the usb accelerator would be enough for me, so I ordered one of it and tested on my Raspberry Pi 3B+. |
| 15 | + |
| 16 | +---- |
| 17 | + |
| 18 | +## 1. Purchase |
| 19 | + |
| 20 | +Fortunately, the shipping and delivery fee to my country was *zero* on Mouser. |
| 21 | + |
| 22 | +Ordered on Saturday and received on Monday. |
| 23 | + |
| 24 | +What an amazing delivery! |
| 25 | + |
| 26 | +## 2. Unboxing |
| 27 | + |
| 28 | + |
| 29 | + |
| 30 | + |
| 31 | + |
| 32 | + |
| 33 | + |
| 34 | + |
| 35 | + |
| 36 | + |
| 37 | + |
| 38 | +## 3. Configuration |
| 39 | + |
| 40 | +Following [this guide](https://coral.withgoogle.com/tutorials/accelerator/), I downloaded and unzipped [edgetpu_api.tar.gz](https://coral.withgoogle.com/tutorials/accelerator/) |
| 41 | + |
| 42 | +and executed `python-tflite-source/install.sh`. |
| 43 | + |
| 44 | +It installed several packages, changed udev rules, and copied library files. |
| 45 | + |
| 46 | +The guide advices to plug in & out the usb accelerator, but to make sure, I just rebooted the machine. |
| 47 | + |
| 48 | +## 4. Test |
| 49 | + |
| 50 | +In the `edgetpu` directory, ran following command: |
| 51 | + |
| 52 | +{% highlight bash %} |
| 53 | +python3 demo/classify_image.py \ |
| 54 | +--model test_data/mobilenet_v2_1.0_224_inat_bird_quant_edgetpu.tflite \ |
| 55 | +--label test_data/inat_bird_labels.txt \ |
| 56 | +--image test_data/parrot.jpg |
| 57 | +{% endhighlight %} |
| 58 | + |
| 59 | +and got almost the same result: |
| 60 | + |
| 61 | +{% highlight bash %} |
| 62 | +W0320 09:13:03.732145 6245 package_registry.cc:65] Minimum runtime version required by package (5) is lower than expected (10). |
| 63 | +--------------------------- |
| 64 | +Ara macao (Scarlet Macaw) |
| 65 | +Score : 0.61328125 |
| 66 | +--------------------------- |
| 67 | +Platycercus elegans (Crimson Rosella) |
| 68 | +Score : 0.15234375 |
| 69 | +{% endhighlight %} |
| 70 | + |
| 71 | +There was a warning message: `Minimum runtime version required by package (5) is lower than expected (10).`. |
| 72 | + |
| 73 | +It doesn't seem like a critical issue, but needs to be fixed sooner or later. |
| 74 | + |
| 75 | +## 5. What now? |
| 76 | + |
| 77 | +So, I got the usb accelerator and made sure it runs ok on my Raspberry Pi, but what to do now? |
| 78 | + |
| 79 | +Maybe I need to learn TensorFlow Lite and related stuffs, train my own models, and build some applications with them. |
| 80 | + |
0 commit comments