Skip to content

Instantly share code, notes, and snippets.

@pra-dan
Last active April 16, 2020 09:05
Show Gist options
  • Save pra-dan/3ddd32fbc9e6054f3ed3a2a02c0b1936 to your computer and use it in GitHub Desktop.
Save pra-dan/3ddd32fbc9e6054f3ed3a2a02c0b1936 to your computer and use it in GitHub Desktop.
!pip install tensorflow-gpu==1.15.0
# Convert
!toco --graph_def_file /content/yolo-v2-tiny-coco.pb \
--output_file yolo-v2-tiny-coco.tflite \
--output_format TFLITE \
--inference_type FLOAT \
--inference_input_type FLOAT \
--input_arrays input \
--output_arrays output
# Now let's quantize it
!toco --graph_def_file /content/yolo-v2-tiny-coco.pb \
--output_file quantized-yolo-v2-tiny-coco.tflite \
--output_format TFLITE \
--inference_type FLOAT \
--inference_input_type FLOAT \
--input_arrays input \
--output_arrays output \
--post_training_quantize
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment