You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Windows 10
TensorFlow installation (pip package or built from source): pip
TensorFlow library (version, if pip package or github SHA, if built from source): tf-nightly 2.6 dev
I am trying to create a representative data set for conversion to tflite and perform a int8 quantize operations. I was wondering, is it possible to use TFrecords as a input data to be used to create a representative_dataset instead of looping through each images to generate a representative_dataset? This is due to no examples of using TFrecords in the API but the API just says you can load TFrecord and create a dataset for manipulation.
The text was updated successfully, but these errors were encountered:
def representative_dataset_generator():
"""Dataset generator that generates random tensor with the same shape as the input"""
filenames = [filename]
raw_dataset = tf.data.TFRecordDataset(filenames)
for raw_record in raw_dataset.take(10):
# manipulate the raw_record to get the right shape.
yield raw_record # raw_record is just a tensor
Just tried it. Threw a error TypeError: 'generator' object is not callable in tensorflow/tensorflow/lite/python/optimize/calibrator.py at:
for sample in dataset_gen():
if not initialized:
initialized = True
self._calibrator.Prepare([list(s.shape) for s in sample])
self._calibrator.FeedTensor(sample)
return self._calibrator.Calibrate()
I will try debug and see what went wrong with the conversion process.
1. System information
I am trying to create a representative data set for conversion to tflite and perform a int8 quantize operations. I was wondering, is it possible to use TFrecords as a input data to be used to create a
representative_dataset
instead of looping through each images to generate arepresentative_dataset
? This is due to no examples of using TFrecords in the API but the API just says you can load TFrecord and create a dataset for manipulation.The text was updated successfully, but these errors were encountered: