4580ec74800db2a9e4288d49c36c41b1c2077c42,donkeycar/parts/tflite.py,,keras_model_to_tflite,#Any#Any#Any#,3

Before Change


    verStr = tf.__version__
    if verStr.find("1.1")  == 0: // found MAJOR.MINOR match for version 1.1x.x
        converter = tf.lite.TFLiteConverter.from_keras_model_file(in_filename)
    if verStr.find("2.")  == 0: // found MAJOR.MINOR match for version 2.x.x
        new_model= tf.keras.models.load_model(in_filename) //filepath="keras_model.h5")
        converter = tf.lite.TFLiteConverter.from_keras_model(new_model)
    if data_gen is not None:
        //when we have a data_gen that is the trigger to use it to 
        //create integer weights and calibrate them. Warning: this model will
        //no longer run with the standard tflite engine. That uses only float.

After Change




def keras_model_to_tflite(in_filename, out_filename, data_gen=None):
    print("Convert model {:} to TFLite {:}".format(in_filename, out_filename))
    new_model = tf.keras.models.load_model(in_filename)
    converter = tf.lite.TFLiteConverter.from_keras_model(new_model)
    if data_gen is not None:
        // when we have a data_gen that is the trigger to use it to create
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: autorope/donkeycar
Commit Name: 4580ec74800db2a9e4288d49c36c41b1c2077c42
Time: 2020-10-04
Author: tikurahul@gmail.com
File Name: donkeycar/parts/tflite.py
Class Name:
Method Name: keras_model_to_tflite


Project Name: tensorlayer/tensorlayer
Commit Name: d4148319e7ea14d3f747dc8fef06819adb3caf50
Time: 2018-02-17
Author: lg4869@outlook.com
File Name: tests/test_yapf_format.py
Class Name:
Method Name: check_all_files


Project Name: unitedstates/congress-legislators
Commit Name: 4a317ef89f89e335446bfb9c554d381284873c52
Time: 2016-03-16
Author: jconline@gmail.com
File Name: scripts/house_contacts.py
Class Name:
Method Name: run