在微调/重新训练InceptionV1 slim模型时遇到”No Operation named [input] in the Graph”错误

我正在尝试在此处使用自己的数据微调/重新训练InceptionV1模型。我能够

  1. 使用这个将图像数据转换为TFR格式数据。

  2. 将转换后的数据传递给finetune_inception_v1_on_flowers

  3. 根据上述脚本文件完成训练和评估,我在这里附上日志。

    INFO:tensorflow:global step 1000: loss = 0.1833 (20.37 sec/step) INFO:tensorflow:Stopping Training. INFO:tensorflow:Finished training! Saving model to disk. INFO:tensorflow:Scale of 0 disables regularizer. WARNING:tensorflow:From eval_image_classifier.py:157: streaming_recall_at_k (from tensorflow.contrib.metrics.python.ops.metric_ops) is deprecated and will be removed after 2016-11-08. Instructions for updating: Please use streaming_sparse_recall_at_k, and reshape labels from [batch_size] to [batch_size, 1].     INFO:tensorflow:Evaluating /tmp/flowers-models/inception_v1/all/model.ckpt-1000     INFO:tensorflow:Starting evaluation at 2017-04-26-14:59:28 INFO:tensorflow:Restoring parameters from /tmp/flowers-models/inception_v1/all/model.ckpt-1000     INFO:tensorflow:Evaluation [1/4]     INFO:tensorflow:Evaluation [2/4]     INFO:tensorflow:Evaluation [3/4]     INFO:tensorflow:Evaluation [4/4]     2017-04-26 20:30:23.505265: I tensorflow/core/kernels/logging_ops.cc:79] eval/Recall_5[1]     2017-04-26 20:30:23.505420: I tensorflow/core/kernels/logging_ops.cc:79] eval/Accuracy[1]     INFO:tensorflow:Finished evaluation at 2017-04-26-15:00:23

4.训练过程生成了许多检查点和两个graph.pbtxt文件。我使用了最新的检查点和graph.pbtxt文件在冻结工具中生成了一个.pb文件,根据这里的讨论,我使用了以下参数

–input_graph=/../../graph.pbtxt

–output_node_names=InceptionV1/Logits/Predictions/Softmax

 

  1. 现在我尝试在tensorflow演示应用程序中使用.pb文件,通过对tensorflow演示Android应用中的ClassifierActivity.java进行一些更改,它显示了一个错误,

No Operation named [input] in the Graph

以下是我对ClassifierActivity.java所做的更改

private static final int INPUT_SIZE = 224;//224//299

private static final int IMAGE_MEAN = 117;//117//128

private static final float IMAGE_STD = 1;//1//128

private static final String INPUT_NAME =”input”;//input

private static final String OUTPUT_NAME =”InceptionV1/Logits/Predictions/Softmax”;//output

private static final String MODEL_FILE =”file:///android_asset/frozen_1000_graph.pb”;//tensorflow_inception_graph

private static final String LABEL_FILE =”file:///android_asset/labels.txt”;//imagenet_comp_graph_label_strings

  1. 如上面的讨论链接所建议,我在我的frozen_1000_graph.pb上尝试了Summarize graph工具,并得到了以下输出。

No inputs spotted. No variables spotted. Found 1 possible outputs: (name=InceptionV1/Logits/Predictions/Softmax, op=Softmax) Found 5598451 (5.60M) const parameters, 0 (0) variable parameters, and 114 control_edges Op types used: 472 Const, 230 Mul, 173 Add, 172 Sub, 116 Identity, 114 Sum, 58 Reshape, 58 Conv2D, 57 Rsqrt, 57 Relu, 57 Reciprocal, 57 Square, 57 SquaredDifference, 57 Mean, 57 StopGradient, 13 MaxPool, 9 ConcatV2, 1 Squeeze, 1 RandomUniform, 1 Softmax, 1 RealDiv, 1 QueueDequeueV2, 1 Floor, 1 FIFOQueueV2, 1 BiasAdd, 1 AvgPool.

请帮助我理解如何解决这个问题


回答:

这里是网络创建的输入,所以如果你可以添加images = tf.identity(images, name=’Inputs’)来为网络命名张量。

Related Posts

L1-L2正则化的不同系数

我想对网络的权重同时应用L1和L2正则化。然而,我找不…

使用scikit-learn的无监督方法将列表分类成不同组别,有没有办法?

我有一系列实例,每个实例都有一份列表,代表它所遵循的不…

f1_score metric in lightgbm

我想使用自定义指标f1_score来训练一个lgb模型…

通过相关系数矩阵进行特征选择

我在测试不同的算法时,如逻辑回归、高斯朴素贝叶斯、随机…

可以将机器学习库用于流式输入和输出吗?

已关闭。此问题需要更加聚焦。目前不接受回答。 想要改进…

在TensorFlow中,queue.dequeue_up_to()方法的用途是什么?

我对这个方法感到非常困惑,特别是当我发现这个令人费解的…

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注