背景:我正在尝试从官方的tf动物园转换SSD MobileNet V2 FPNLite 320x320 (例如)的tf2模型。模型最终应该运行在raspberry pi上,所以我希望它能在tflite解释器上运行(没有完全的tf)。这些文档意味着支持ssd模型转换。
发生了什么:过程在这个colab笔记本中有详细的描述。由于错误,它失败了:
ConverterError: <unknown>:0: error: loc(callsite(callsite("Postprocessor/BatchMultiClassNonMaxSuppression/MultiClassNonMaxSuppression/SortByField_1/Size@__inference___call___23519" at "StatefulPartitionedCall@__inference_signature_wrapper_25508") at "StatefulPartitionedCall")): 'tf.Size' op is neither a custom op nor a flex op
<unknown>:0: note: loc("StatefulPartitionedCall"): called from
<unknown>:0: error: failed while converting: 'main': Ops that can be supported by the flex runtime (enabled via setting the -emit-select-tf-ops flag):
tf.Size {device = ""}
如果我添加标志tf.lite.OpsSet.SELECT_TF_OPS,它可以工作,但不会在rpi上运行,因为它没有操作系统。
这能办到吗?有人成功了吗?
发布于 2021-01-14 09:32:38
由于TF.Size在TFLite上本机不受支持,所以您可以使用TF选择模式,对于缺少的op,TFLite将在转换过程中使用您尝试的"SELECT_TF_OPS“启用。当您运行推断时,您将需要使用具有Select链接的解释器。请参阅运行推理时的指南。
https://stackoverflow.com/questions/65712409
复制