Tensorflow 目标检测API v2 Tflite模型后量化
我尝试转换和量化一个使用对象检测API v2训练的模型,以便在Coral Devboard上运行它 似乎将对象检测模型导出到lite仍然存在一个大问题,尽管我希望有人能给我一些建议 我的转换器如下所示,我尝试将“SSD MobileNet v2 320x320”从 我的Datagenerator加载从coco数据集下载的大约100个图像,以生成样本输入Tensorflow 目标检测API v2 Tflite模型后量化,tensorflow,tensorflow-lite,object-detection-api,quantization,Tensorflow,Tensorflow Lite,Object Detection Api,Quantization,我尝试转换和量化一个使用对象检测API v2训练的模型,以便在Coral Devboard上运行它 似乎将对象检测模型导出到lite仍然存在一个大问题,尽管我希望有人能给我一些建议 我的转换器如下所示,我尝试将“SSD MobileNet v2 320x320”从 我的Datagenerator加载从coco数据集下载的大约100个图像,以生成样本输入 def _genDataset(): sampleDir = os.path.join("Dataset", "C
def _genDataset():
sampleDir = os.path.join("Dataset", "Coco")
for i in os.listdir(sampleDir):
image = cv2.imread(os.path.join(sampleDir, i))
image = cv2.cvtColor(image, cv2.COLOR_BGR2RGB)
image = cv2.resize(image, (300,300))
image = image.astype("float")
image = np.expand_dims(image, axis=1)
image = image.reshape(1, 300, 300, 3)
yield [image.astype("float32")]
我尝试使用返回我的TF2.2.0对代码进行tun
RuntimeError: Max and min for dynamic tensors should be recorded during calibration
根据对TF2.3.0的更新,当返回我时应该会有所帮助
<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.Size操作符似乎是我可以转换模型的原因,因为当我允许自定义操作时,我可以将它转换为tflite。
遗憾的是,这对我来说不是一个解决方案,因为coral转换器或我的解释器无法使用缺少自定义op的模型
有人知道是否有可能在后处理中删除此op,或者在转换过程中忽略它吗
只需将其转换为TFlite而无需量化,tf.lite.optsset.TFlite_内置程序就可以正常工作
有进展吗?面对同样的问题有什么进展?面对同样的问题
<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 = ""}
RuntimeError: Max and min for dynamic tensors should be recorded during calibration