问题描述
我正在使用Tflite。我正在学习如何量化为INT8。
我正在使用Colab教程。
“ flowers_dir”是一个包含5个文件夹的文件夹(每个文件夹包含不同类型的花朵)。
'/*/*'
是什么意思?我的直觉告诉我,这是调用每个文件夹的内容。不确定。有没有像“教程”那样解释它?
# A generator that provides a representative dataset
def representative_data_gen():
dataset_list = tf.data.Dataset.list_files(flowers_dir + '/*/*')
for i in range(100):
image = next(iter(dataset_list))
image = tf.io.read_file(image)
image = tf.io.decode_jpeg(image,channels=3)
image = tf.image.resize(image,[IMAGE_SIZE,IMAGE_SIZE])
image = tf.cast(image / 255.,tf.float32)
image = tf.expand_dims(image,0)
yield [image]
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)