TFLITE是否有等效于Iterators的替代运算符?

时间:2019-03-28 06:05:07

标签: tensorflow tensorflow-lite

我已经requested few operators to be supported for TFLITE。但是想知道是否有替代方法可以在不使用迭代器的情况下迭代数据集吗?

目标是使用MNIST训练数据集(55K图像)分批迭代所有训练数据

这是一个片段:

train_data = tf.data.Dataset.from_tensor_slices(train)
train_data = train_data.shuffle(10000)                                                                 
train_data = train_data.batch(batch_size)

iterator = tf.data.Iterator.from_structure(train_data.output_types,                                                                        
                                           train_data.output_shapes)
img, label = iterator.get_next()
train_init = iterator.make_initializer(train_data)

TFLITE转换错误:

tensorflow.lite.python.convert.ConverterError: TOCO failed. See console for info.
2019-03-27 17:40:24.648521: I tensorflow/lite/toco/import_tensorflow.cc:1324] Converting unsupported operation: IteratorV2
2019-03-27 17:40:24.656267: I tensorflow/lite/toco/import_tensorflow.cc:193] Unsupported data type in placeholder op: 20
2019-03-27 17:40:24.656283: I tensorflow/lite/toco/import_tensorflow.cc:1324] Converting unsupported operation: IteratorGetNext
2019-03-27 17:40:24.656301: I tensorflow/lite/toco/import_tensorflow.cc:193] Unsupported data type in placeholder op: 2
2019-03-27 17:40:24.656376: I tensorflow/lite/toco/import_tensorflow.cc:193] Unsupported data type in placeholder op: 2
2019-03-27 17:40:24.656460: I tensorflow/lite/toco/import_tensorflow.cc:1324] Converting unsupported operation: SoftmaxCrossEntropyWithLogits
2019-03-27 17:40:24.656709: I tensorflow/lite/toco/graph_transformations/graph_transformations.cc:39] Before Removing unused ops: 21 operators, 35 arrays (0 quantized)
2019-03-27 17:40:24.656884: I tensorflow/lite/toco/graph_transformations/graph_transformations.cc:39] Before general graph transformations: 21 operators, 35 arrays (0 quantized)
2019-03-27 17:40:24.657083: I tensorflow/lite/toco/graph_transformations/graph_transformations.cc:39] After general graph transformations pass 1: 13 operators, 24 arrays (0 quantized)
2019-03-27 17:40:24.657094: F tensorflow/lite/toco/tooling_util.cc:897] Check failed: GetOpWithInput(model, input_array.name()) Specified input array "weights" is not consumed by any op in this graph. Is it a typo? To silence this message, pass this flag:  allow_nonexistent_arrays

0 个答案:

没有答案