相关疑难解决方法(0)

如何测试.tflite模型以证明其行为与使用相同测试数据的原始模型相同?

我已经根据训练过的模型生成了一个.tflite模型,我想测试一下tfilte模型给出与原始模型相同的结果.

给出相同的测试数据并获得相同的结果.

python tensorflow tensorflow-lite

18
推荐指数
1
解决办法
8500
查看次数

TensorFlow lite:将模型转换为 tflite 后精度损失较大

我一直在尝试 TFLite 来提高 Android 上的检测速度,但奇怪的是我的 .tflite 模型现在几乎只检测 1 个类别。

\n\n

我已经对重新训练 mobilenet 后获得的 .pb 模型进行了测试,结果很好,但由于某种原因,当我将其转换为 .tflite 时,检测结果相差甚远......

\n\n

对于重新训练,我使用了Tensorflow for Poets 2中的 retrain.py 文件

\n\n

我使用以下命令来重新训练、优化推理并将模型转换为 tflite:

\n\n
python retrain.py \\\n--image_dir ~/tf_files/tw/ \\\n--tfhub_module https://tfhub.dev/google/imagenet/mobilenet_v1_100_224/feature_vector/1 \\\n--output_graph ~/new_training_dir/retrainedGraph.pb \\\n-\xe2\x80\x93saved_model_dir ~/new_training_dir/model/ \\\n--how_many_training_steps 500 \n\nsudo toco \\\n--input_file=retrainedGraph.pb \\\n--output_file=optimized_retrainedGraph.pb \\\n--input_format=TENSORFLOW_GRAPHDEF \\\n--output_format=TENSORFLOW_GRAPHDEF \\\n--input_shape=1,224,224,3 \\\n--input_array=Placeholder \\\n--output_array=final_result \\\n\nsudo toco \\\n--input_file=optimized_retrainedGraph.pb \\\n--input_format=TENSORFLOW_GRAPHDEF \\\n--output_format=TFLITE \\\n--output_file=retrainedGraph.tflite \\\n--inference_type=FLOAT \\\n--inference_input_type=FLOAT \\\n--input_arrays=Placeholder \\\n--output_array=final_result \\\n--input_shapes=1,224,224,3\n
Run Code Online (Sandbox Code Playgroud)\n\n

我在这里做错了什么吗?准确性的损失从何而来?

\n

tensorflow tensorflow-lite

5
推荐指数
2
解决办法
3574
查看次数

标签 统计

tensorflow ×2

tensorflow-lite ×2

python ×1