【问题标题】:Evaluating Imagenet accuracy of TF Lite models with official tool使用官方工具评估 TF Lite 模型的 Imagenet 精度
【发布时间】:2021-05-31 10:16:42
【问题描述】:

我在官方量化的 MobileNet V2 上使用了官方 Imagenet 精度评估工具,位于 tensorflow/tensorflow/lite/tools/evaluation/tasks/imagenet_image_classification/。然而,报告的准确性远低于预期。 MB V2 从https://tfhub.dev/tensorflow/lite-model/mobilenet_v2_1.0_224_quantized/1/default/1 下载。下面的运行设置尽量遵循instructions。请帮助解释准确性差距。

命令:

bazel run -c opt \
-- \
//tensorflow/lite/tools/evaluation/tasks/imagenet_image_classification:run_eval \
--model_file=/home/ubuntu/workspace/tensorflow/mobilenet_v2_1.0_224_quantized_1_default_1.tflite \
--ground_truth_images_path=${IMAGENET_IMAGES_DIR} \
--ground_truth_labels=${VALIDATION_LABELS} \
--model_output_labels=${MODEL_LABELS_TXT_LONG} \
--output_file_path=/tmp/accuracy_output.txt \
--num_interpreter_threads=4 \
--num_images=0

输出:

Num evaluation runs: 50000
Preprocessing latency: avg=7697.15(us), std_dev=0(us)
Inference latency: avg=77301.9(us), std_dev=6485(us)
Top-1 Accuracy: 0.35942
Top-2 Accuracy: 0.41372
Top-3 Accuracy: 0.43532
Top-4 Accuracy: 0.4475
Top-5 Accuracy: 0.4553
Top-6 Accuracy: 0.46088
Top-7 Accuracy: 0.46498
Top-8 Accuracy: 0.46842
Top-9 Accuracy: 0.47142
Top-10 Accuracy: 0.4736

【问题讨论】:

    标签: tensorflow tensorflow-lite


    【解决方案1】:

    您是否尝试过使用说明文档中指定的 v1 型号?如果这工作正常,我会怀疑在插入推理之前数据预处理的差异,否则我猜该指令应该报告为错误。

    【讨论】:

      猜你喜欢
      • 2019-03-18
      • 2019-10-30
      • 1970-01-01
      • 2020-10-29
      • 2023-01-16
      • 2023-03-21
      • 1970-01-01
      • 2019-05-24
      • 2019-05-10
      相关资源
      最近更新 更多