【问题标题】:TensorFlow lite .pb turn .tflite An errorTensorFlow lite .pb 转 .tflite 报错
【发布时间】:2018-06-06 08:11:31
【问题描述】:

错误信息

 F tensorflow/contrib/lite/toco/toco.cc:76] Check failed: has_input_file != has_savedmodel_dir (0 vs. 0)Specify either input_file or savedmodel_directory flag.

冻结图 https://storage.googleapis.com/download.tensorflow.org/models/mobilenet_v1_1.0_224_frozen.tgz

转换命令

bazel run toco  \
  input_file=/Users/dchealth/Desktop/mobilenet/frozen_graph.pb \
  output_file=/Users/dchealth/Desktop/mobilenet/frozen_graphnew.tflite \
  output_format=TFLITE \
  input_format=TENSORFLOW_GRAPHDEF \
  inference_type=FLOAT \
  input_type=FLOAT \
  input_shapes=1,128,128,3 \
  input_arrays=input \
  output_arrays=MobilenetV1/Predictions/Reshape_1

什么原因

enter image description here

【问题讨论】:

    标签: android ios tensorflow tensorflow-lite


    【解决方案1】:

    我认为您需要为标志传递'--',如下所示。

    bazel run --config=opt \
      tensorflow/contrib/lite/toco:toco -- \
      --input_file=/Users/dchealth/Desktop/mobilenet/frozen_graph.pb \
      --output_file=/Users/dchealth/Desktop/mobilenet/frozen_graphnew.tflite \
      --inference_type=FLOAT \
      --input_type=FLOAT \
      --input_shape=1,128,128,3 \
      --input_arrays=input \
      --output_arrays=MobilenetV1/Predictions/Reshape_1
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-09-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-12-03
      • 1970-01-01
      • 1970-01-01
      • 2019-05-08
      相关资源
      最近更新 更多