Tensorflow iOS使用重新训练的初始模型在简单和相机示例中返回不同的结果

时间:2017-01-19 06:27:03

标签: ios machine-learning tensorflow

我重新训练了初始模型以识别自定义图像集。我尝试过简单的相机示例,并将.pb和.txt文件替换为我自己的文件。使用简单示例(将grace_hopper替换为我的图像)时,我能够获得0.99概率的可靠结果。但是,在使用相机示例时,我得到了不同的结果。我将相机指向照片,但结果似乎与简单示例中的结果不同。我使用的配置如下,是否需要进行任何配置?谢谢。

const int wanted_input_width = 299;
const int wanted_input_height = 299;
const int wanted_input_channels = 3;
const float input_mean = 128.0f;
const float input_std = 128.0f;
const std::string input_layer_name = "Mul";
const std::string output_layer_name = "final_result";

1 个答案:

答案 0 :(得分:1)

输入/输出图层在Inception v1(与Android演示版打包的版本)和v3(您重新训练的版本)之间发生了变化。

您需要使用Inception v3的值更新ClassifierActivity.java中的常量(也可在那里的注释中找到)。