Skip to content

Instantly share code, notes, and snippets.

@maifeeulasad
Created April 21, 2021 11:30
Show Gist options
  • Select an option

  • Save maifeeulasad/d7e67b50e378584b9f3a9761eaa93da6 to your computer and use it in GitHub Desktop.

Select an option

Save maifeeulasad/d7e67b50e378584b9f3a9761eaa93da6 to your computer and use it in GitHub Desktop.

Revisions

  1. maifeeulasad created this gist Apr 21, 2021.
    7 changes: 7 additions & 0 deletions converter.py
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,7 @@
    import tensorflow as tf

    model = tf.keras.models.load_model('name_gender.h5')
    converter = tf.lite.TFLiteConverter.from_keras_model(model)
    tflite_model = converter.convert()
    open("converted_model.tflite", "wb").write(tflite_model)