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:
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

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: PyThaiNLP/pythainlp
Commit Name: b7ff45e0e63da05d2a118f8e050e9b20b9eb0f09
Time: 2018-11-04
Author: arthit@gmail.com
File Name: pythainlp/number/thainum.py
Class Name:
Method Name: bahttext


Project Name: mittagessen/kraken
Commit Name: a2036258d7628f43cffd89b446077e13e2da2f7d
Time: 2019-10-30
Author: mittagessen@l.unchti.me
File Name: kraken/lib/xml.py
Class Name:
Method Name: parse_page