找到我需要为lstm构建自定义tflite的标头

时间:2019-02-12 14:14:08

标签: tensorflow keras tensorflow-lite

我试图将tf.keras模型转换为tflite,但是遇到了一些缺少的运算符。 TOCO输出包含以下字符串-我试图使其具有唯一性,而不是转储整个内容

Converting unsupported operation: TensorArrayV3
Op node missing output type attribute: lstm_4/TensorArray
Converting unsupported operation: TensorArrayScatterV3
Op node missing output type attribute: lstm_4/TensorArrayUnstack/TensorArrayScatter/TensorArrayScatterV3
Converting unsupported operation: Enter
Converting unsupported operation: LoopCond
Op node missing output type attribute: lstm_4/while/LoopCond
Converting unsupported operation: TensorArrayReadV3
Unsupported data type in placeholder op: 20
Converting unsupported operation: ReadVariableOp
Converting unsupported operation: TensorArrayWriteV3
Op node missing output type attribute: lstm_4/while/TensorArrayWrite/TensorArrayWriteV3
Converting unsupported operation: Exit
Converting unsupported operation: TensorArraySizeV3
Op node missing output type attribute: lstm_4/TensorArrayStack/TensorArraySizeV3
Converting unsupported operation: TensorArrayGatherV3
Op node missing output type attribute: lstm_5/TensorArray
Op node missing output type attribute: lstm_5/TensorArray_1
Op node missing output type attribute: lstm_5/TensorArrayUnstack/TensorArrayScatter/TensorArrayScatterV3
Op node missing output type attribute: lstm_5/while/LoopCond
Op node missing output type attribute: lstm_5/while/TensorArrayWrite/TensorArrayWriteV3
Op node missing output type attribute: lstm_5/TensorArrayStack/TensorArraySizeV3
Op node missing output type attribute: lstm_6/TensorArray
Op node missing output type attribute: lstm_6/TensorArray_1
Op node missing output type attribute: lstm_6/TensorArrayUnstack/TensorArrayScatter/TensorArrayScatterV3
Op node missing output type attribute: lstm_6/while/LoopCond
Op node missing output type attribute: lstm_6/while/TensorArrayWrite/TensorArrayWriteV3

因此,我正在阅读有关如何支持这些操作的信息-显然,该方法是使用这些操作进行自定义构建。有a promising looking guide,但他并没有真正说明他如何找到所需的标题。

您能帮我找到需要包括的标题吗?

更新

我已经为TensorArrayV3找到了……显然只有1个文件:tensorflow/lite/java/src/main/native/tensor_array_ops.h

此文件使用默认情况下未编译的protobuf(存在原始的 host_compute_metadata.proto ,但没有 .pb.h / 。 pb.cc 文件)。我在充分了解构建系统时遇到了麻烦,无法知道在哪里构建这些...我下载了自己的协议并可以对其进行编译,但是我不确定自己是否做得正确,并且还引用了另外两个.proto。也未编译为 .pb。* 的文件,即从核心文件开始的types.prototensor_shape.proto。编译核心不会生成它们。

0 个答案:

没有答案