【问题标题】:Custom implementation for Dequantize when converting .pb to .tflite将 .pb 转换为 .tflite 时的 Dequantize 自定义实现
【发布时间】:2018-06-20 06:37:08
【问题描述】:

我正在尝试使用 toco 将 tensorflow lite 量化 .pb 文件转换为 .lite。创建 .pb 文件的命令是:
retrain.py 是herehere

python retrain.py \
--bottleneck_dir=/mobilenet_q/bottlenecks \
--how_many_training_steps=4000 \
--output_graph=/mobilenet_q/retrained_graph_mobilenet_q_1_224.pb \
--output_labels=/mobilenet_q/retrained_labels_mobilenet_q_1_224.txt \
--image_dir=/data \
--architecture=mobilenet_1.0_224_quantized

当我尝试使用 toco 命令将 .pb 文件转换为 .tflite 时:

bazel run --config=opt //tensorflow/contrib/lite/toco:toco \
  -- --input_file= retrained_graph_mobilenet_q_1_224.pb \
  --output_file= retrained_graph_mobilenet_q_1_224.lite \
  --input_format=TENSORFLOW_GRAPHDEF \
  --output_format=TFLITE \
  --input_shape=1,224,224,3 \
  --input_array=input \
  --output_array=final_result \
  --inference_type=FLOAT \
  --input_data_type=FLOAT

我收到错误: Some of the operators in the model are not supported by the standard TensorFlow Lite runtime. If you have a custom implementation for them you can disable this error with --allow_custom_ops, or by setting allow_custom_ops=True when calling tf.contrib.lite.toco_convert(). Here is a list of operators for which you will need custom implementations: Dequantize.

我在 github 和 stackoverflow 中搜索过,但没有找到满意的答案。

【问题讨论】:

    标签: android python tensorflow convolutional-neural-network


    【解决方案1】:

    讨论和解决方法是here

    【讨论】:

      猜你喜欢
      • 2019-05-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-03-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多