Setting up Google Coral USB accelerator on Raspberry Pi 4 for Donkey Car

1. Make sure you have a steady power supply

Use this handy one-liner to check the status.

vcgencmd version; vcgencmd get_throttled; vcgencmd measure_volts; vcgencmd measure_temp;vcgencmd measure_clock arm;

You can also stress test your Pi to see if your power supply is stable enough.

2. Take care of system cooling

3. Install Edgetpu library

edgetpu_api/ line 51: warning: command substitution: ignored null byte in input
Your platform is not supported.

I have add the following lines in edgetpu_api/ to make it work:

elif [[ "${MODEL}" == "Raspberry Pi 4 Model B Rev"* ]]; then
info "Recognized as Raspberry Pi 4B."

You might also run into the following error:

ModuleNotFoundError: No module named '_edgetpu_cpp_wrapper'

As advised by the coral doc, copy the library for python 3.7

cd /usr/local/lib/python3.7/dist-packages/edgetpu/swig
sudo cp

4. Run a demo

cd /usr/local/lib/python3.7/dist-packages/edgetpu/demopython3 \
--model ~/Downloads/mobilenet_v2_1.0_224_inat_bird_quant_edgetpu.tflite \
--label ~/Downloads/inat_bird_labels.txt \
--image ~/Downloads/parrot.jpg

5. Install the EdgeTPU in your virtual env

# The virtual environment is called env in donkey car
cd ~/env/lib/python3.7/site-packages
ln -s /usr/local/lib/python3.7/dist-packages/edgetpu .
ln -s /usr/local/lib/python3.7/dist-packages/edgetpu-2.11.1.dist-info .

If you are setting up your local PC to use the coral and you are using conda, do this:

cd ~/anaconda3/envs/<your_env>/lib/python3.7/site-packagesln -s /usr/local/lib/python3.7/dist-packages/edgetpu .
ln -s /usr/local/lib/python3.7/dist-packages/edgetpu-2.11.1.dist-info .

That’s it. If you have any question, just leave me some message. If you want to purchase donkey car, you could visit our store and check out our community on facebook.

Love Self-driving technology and machine learning. Community leader in DIYRobocar Hong Kong.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store