Skip to content

Instantly share code, notes, and snippets.

@antonyharfield
Last active June 13, 2020 13:29
Show Gist options
  • Save antonyharfield/b5c889dcb1f07fc4432f66c3c952a64f to your computer and use it in GitHub Desktop.
Save antonyharfield/b5c889dcb1f07fc4432f66c3c952a64f to your computer and use it in GitHub Desktop.
YAMNet to TFLite failed conversion 1
import tensorflow as tf
import params
import yamnet
def main():
# Load the model and weights
model = yamnet.yamnet_frames_model(params)
model.load_weights('yamnet.h5')
# Convert the model
converter = tf.lite.TFLiteConverter.from_keras_model(model)
tflite_model = converter.convert()
open("yamnet.tflite", "wb").write(tflite_model)
if __name__ == '__main__':
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment