Tensorflow slim train and validate inception model
<p>I'm trying to fine tune inception models, and validate it with test data. But all the examples given at tensorflow slime web page only either fine-tuning or testing, there is not any example that doing both at same graph and session. </p>

<p>Basically I want to this. </p>

<pre><code>with tf.Graph().as_default():
 image, image_raw,  label,image_name, label_name = dut.distorted_inputs(params,is_training=is_training)
 test_image, test_image_raw,  test_label,test_image_name, test_label_name = dut.distorted_inputs(params,is_training=False)

 # I'm creating as it is suggested at github slim page:
 logits, _ =inception.inception_v2(image, num_classes=N, is_training=True)
 tf.get_variable_scope().reuse_variables()
 logits_tes, _ =inception.inception_v2(test_image, num_classes=N, is_training=Test)
 err=tf.sub(logits, label)
 losses = tf.reduce_mean(tf.reduce_sum(tf.square(err)))
 # total_loss = model_loss+losses
 total_loss = losses+slim.losses.get_total_loss()
 test_err=tf.sub(test_logits, test_label)
 test_loss= tf.reduce_mean(tf.reduce_sum(tf.square(test_err)))

 optimizer = tf.train.AdamOptimizer(learning_rate=0.001)
 train_op = slim.learning.create_train_op(total_loss, optimizer)

 final_loss = slim.learning.train(
     train_op,
     logdir=params["cp_file"],
     init_fn=ut.get_init_fn(slim,params),
     number_of_steps=2,
     summary_writer=summary_writer
 )
</code></pre>

<p>this code fails As it can be seen, I don't have loop separately to call my test models, I want to test my model on my test data at each 10th batch.</p>

<p>Does calling train with number_of_steps=10 and then using the evaluation code work?</p>

python neural-network tensorflow deep-learning conv-neural-network