We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Does Post-training full integer quantization in https://www.tensorflow.org/lite/performance/post_training_integer_quant#convert_using_float_fallback_quantization support BERT? I convert my pb model to tf lite:
dataset = create_dataset() def representative_dataset(): for data in dataset: yield { "token_type_ids": np.array(data.segment_ids), "attention_mask": np.array(data.input_mask), "input_ids": np.array(data.input_ids), } converter = tf.lite.TFLiteConverter.from_saved_model(pb_dir) converter.optimizations = [tf.lite.Optimize.DEFAULT] converter.representative_dataset = representative_dataset tflite_quant_model = converter.convert() tflite_path = res_tf_lite_file open(tflite_path, "wb").write(tflite_quant_model) assert os.path.exists(tflite_path) print("tflite model={} converted successfully.".format(tflite_path)) interpreter = tf.lite.Interpreter(model_path=tflite_path) # Get input and output tensors input_details = interpreter.get_input_details() output_details = interpreter.get_output_details() print(f'tflite input {input_details}') print(f'tflite output {output_details}')
I use float fallback quantization from https://www.tensorflow.org/lite/performance/post_training_integer_quant. However the result is totally different compare to the not quantization result. Anyone can help? Thanks a lot!
The text was updated successfully, but these errors were encountered:
@yyoon Could you help to solve it? Thanks a lot!
Sorry, something went wrong.
yyoon
No branches or pull requests
Does Post-training full integer quantization in https://www.tensorflow.org/lite/performance/post_training_integer_quant#convert_using_float_fallback_quantization support BERT?
I convert my pb model to tf lite:
I use float fallback quantization from https://www.tensorflow.org/lite/performance/post_training_integer_quant.
However the result is totally different compare to the not quantization result.
Anyone can help? Thanks a lot!
The text was updated successfully, but these errors were encountered: