我正在遵循本教程诗人之流,我创建了自定义培训数据并将其转换为.pb,但是当我尝试使用toco将.pb转换为.tflite时,我得到了一个错误。
2018-10-10 13:56:40.442130: i tensorflow/contrib/lite/toco/import_tensorflow.cc:1233]转换不受支持的操作: DecodeJpeg 2018-10-10 13:56:40.471545: i在删除未使用的操作操作之前: 706个操作符,1102个数组(0量化)2018-1013:56:40.485896: tensorflow/contrib/lite/toco/graph_transformations/graph_transformations.cc:39]删除未使用的操作数1: 607,1003数组(0量化) 2018-10-10 13:56:40.502109: i tensorflow/contrib/lite/toco/graph_transformations/graph_transformations.cc:39]在一般图形转换之前: 607个操作符,1003个数组(0量化)2018-1013:56:40.581854: tensorflow/contrib/lite/toco/graph_transformations/graph_transformations.cc:39]经过1: 129个运算符,327个数组(0量化) 2018-10-10 13:56:40.584067: i tensorflow/contrib/lite/toco/graph_transformations/graph_transformations.cc:39]在一般图形转换后通过2: 126个运算符,321个数组(0量化)2018-1013:56:40.586222: tensorflow/contrib/lite/toco/graph_transformations/graph_transformations.cc:39]经过一般图形转换后通过3: 125个操作符,319个数组(0量化) 2018-10-10 13:56:40.588344: 40.588344: tensorflow/contrib/lite/toco/graph_transformations/graph_transformations.cc:39]在去量化图形转换之前:125个操作符,319个数组(0量化)2018-1013:56:40.590472:i tensorflow/contrib/lite/toco/allocate_transient_arrays.cc:311]总瞬态数组分配的大小:0字节,理论最优值:0字节。2018-10 13:56:40.591866: 40.591866: tensorflow/contrib/lite/toco/tflite/export.cc:304]模型中的一些操作符不受标准TensorFlow Lite运行时的支持。如果您有它们的自定义实现,则可以使用--allow_ disable _ops禁用此错误。以下是您需要自定义实现的操作符列表: DecodeJpeg、ExpandDims。中止(核心倾弃)
发布于 2019-09-14 15:21:35
toco \
--input_format=TENSORFLOW_GRAPHDEF \
--graph_def_file=tf_files/object_graph.pb \
--output_format=TFLITE \
--output_file=tf_files/qobject.lite \
--inference_type=QUANTIZED_UINT8 \
--inference_input_type=QUANTIZED_UINT8 \
--input_arrays=input \
--output_arrays=final_result \
--input_shapes=1,224,224,3\
--mean_values=128 \
--std_dev_values=128 \
--default_ranges_min=0 \
--default_ranges_max=6只需使用此代码,将.pb文件转换为lite,并将其量化
https://stackoverflow.com/questions/52746315
复制相似问题