Skip to content

Instantly share code, notes, and snippets.

@Namburger
Created August 15, 2020 02:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Namburger/b524e7b70ffe8f3d7b5f1de60a3179c5 to your computer and use it in GitHub Desktop.
Save Namburger/b524e7b70ffe8f3d7b5f1de60a3179c5 to your computer and use it in GitHub Desktop.
# Install the edgetpu compiler.
!curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add -
!echo "deb https://packages.cloud.google.com/apt coral-edgetpu-stable main" | sudo tee /etc/apt/sources.list.d/coral-edgetpu.list
!sudo apt-get update
!sudo apt-get install edgetpu-compiler
# Compile our model and make a tarball of the finished trained model.
%cd /content/output_model
!edgetpu_compiler -s ssdlite_mobiledet_custom.tflite
%cd /content/
# Copy the checkpoints, inference graph, pipeline config, and the tflite models
!cp -r /content/train/model.ckpt-25000* /content/output_model
!cp -r /content/inference_graph/* /content/output_model
!tar cvf ssdlite_mobiledet_dog_vs_cat.tar.gz output_model
# Download model and you're done!
from google.colab import files
files.download('/content/ssdlite_mobiledet_dog_vs_cat.tar.gz')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment