在“图形"中没有名为"[输入]"的操作.微调/重新训练初始时出现错误V1苗条模型 [英] No Operation named [input] in the Graph" error while fine tuning/retraining inceptionV1 slim model

查看:578
本文介绍了在“图形"中没有名为"[输入]"的操作.微调/重新训练初始时出现错误V1苗条模型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试根据自己的数据微调/重新训练InceptionV1模型.我能够

I am trying to finetune/retrain InceptionV1 model here, on my own data. I was able to

  1. 使用.

将转换后的数据传递到

Pass the converted data to finetune_inception_v1_on_flowers

根据上面的脚本文件完成培训和评估,我在此处附上日志.

Complete the training and evaluation in according to the script file above, I am attaching the logs here.

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文件.

4.The training process genertaed many checkpoints, two graph.pbtxt files. I used the latest checkpoint and the graph.pbtxt file in the freeze tool and generated a .pb file, according to the discussion here, I used following parameters

-input_graph =/../../graph.pbtxt

--input_graph=/../../graph.pbtxt

-output_node_names = InceptionV1/Logits/Predictions/Softmax

--output_node_names=InceptionV1/Logits/Predictions/Softmax

  1. 现在我试图通过在tensorflow演示android应用中对ClassifierActivity.java进行少量更改来尝试在tensorflow演示应用中使用.pb文件,它向我显示错误,

在图形中没有名为[input]的操作"

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

following are the changes I made toClassifierActivity.java

private静态最终int INPUT_SIZE = 224;//224//299

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

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

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

私有静态最终浮点数IMAGE_STD = 1;//1//128

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

私有静态最终字符串INPUT_NAME ="input";//input

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

私有静态最终字符串OUTPUT_NAME ="InceptionV1/Logits/Predictions/Softmax";//输出

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

私有静态最终字符串MODEL_FILE ="file:///android_asset/frozen_1000_graph.pb";//tensorflow_inception_graph

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

私有静态最终字符串LABEL_FILE ="file:///android_asset/labels.txt";//imagenet_comp_graph_label_strings

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

  1. 按照上面的讨论链接的建议,我在我的Frozen_1000_graph.pb上尝试了Summarize graph工具,并获得了以下输出.

未发现任何输入.没有发现任何变量.找到1个可能的输出: (名称= InceptionV1/Logits/Predictions/Softmax,op = Softmax)已找到 5598451(5.60M)常量参数,0(0)变量参数和114 control_edges使用的Op类型:472 Const,230 Mul,173 Add,172 Sub,116 身份,114总和,58重塑,58 Conv2D,57 Rsqrt,57 Relu,57 倒数,57平方,57平方差,57均值,57停止梯度, 13个MaxPool,9个ConcatV2、1个挤压,1个RandomUniform,1个Softmax,1个 RealDiv,1个QueueDequeueV2、1楼,1个FIFOQueueV2、1个BiasAdd,1个 AvgPool.

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.

请帮助我了解如何解决此问题.

推荐答案

Here are the input to the network created, so if you can add images = tf.identity(images, name='Inputs') to name the tensor to the network.

这篇关于在“图形"中没有名为"[输入]"的操作.微调/重新训练初始时出现错误V1苗条模型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆