Last active
June 13, 2020 13:29
-
-
Save antonyharfield/b5c889dcb1f07fc4432f66c3c952a64f to your computer and use it in GitHub Desktop.
YAMNet to TFLite failed conversion 1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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