############################################### ########### Defining place holders ############ ############################################### image_place = tf.placeholder(tf.float32, shape=([None, height, width, num_channels]), name='image') label_place = tf.placeholder(tf.float32, shape=([None, FLAGS.num_classes]), name='gt') dropout_parameter = tf.placeholder(tf.float32) ################################################## ########### Model + loss + accuracy ############## ################################################## # MODEL joint_arg_scope = net.net_arg_scope(weight_decay=0.0005, is_training=FLAGS.is_training) with tf.contrib.framework.arg_scope(joint_arg_scope): logits_features, end_points = net.net_architecture(image_place, num_classes=FLAGS.num_classes, dropout_keep_prob=dropout_parameter, is_training=FLAGS.is_training) # Define loss with tf.name_scope('loss'): loss_test = tf.reduce_mean(tf.nn.softmax_cross_entropy_with_logits(logits=logits_features, labels=label_place)) # Accuracy with tf.name_scope('accuracy_test'): # Evaluate the model correct_test_prediction = tf.equal(tf.argmax(logits_features, 1), tf.argmax(label_place, 1)) # Accuracy calculation accuracy_test = tf.reduce_mean(tf.cast(correct_test_prediction, tf.float32)) ###############################################
############################################### ########### Defining place holders ############ ############################################### image_place = tf.placeholder(tf.float32, shape=([None, height, width, num_channels]), name='image') label_place = tf.placeholder(tf.float32, shape=([None, FLAGS.num_classes]), name='gt') dropout_parameter = tf.placeholder(tf.float32) ################################################## ########### Model + loss + accuracy ############## ################################################## # MODEL joint_arg_scope = net.net_arg_scope(weight_decay=0.0005, is_training=FLAGS.is_training) with tf.contrib.framework.arg_scope(joint_arg_scope): logits_features, end_points = net.net_architecture(image_place, num_classes=FLAGS.num_classes, dropout_keep_prob=dropout_parameter, is_training=FLAGS.is_training) # Define loss with tf.name_scope('loss'): loss_test = tf.reduce_mean(tf.nn.softmax_cross_entropy_with_logits(logits=logits_features, labels=label_place)) # Accuracy with tf.name_scope('accuracy_test'): # Evaluate the model correct_test_prediction = tf.equal(tf.argmax(logits_features, 1), tf.argmax(label_place, 1)) # Accuracy calculation accuracy_test = tf.reduce_mean(tf.cast(correct_test_prediction, tf.float32)) ###############################################