def debug_train_setup(self):
""" Use this SOLELY to figure out the size of the feature maps. """
x = tf.placeholder(tf.float32,shape=(None,\
self.cfg.g("image_height"),\
self.cfg.g("image_width"),\
self.cfg.g("n_channels")),\
name='x')
y = tf.placeholder(tf.int32,shape=(None,self.cfg.g("num_preds")),name='y')
one_hot_y = tf.one_hot(y,10)
loc, conf = self._net.graph(x)
# This is just a placeholder cost
cost = tf.reduce_mean(tf.nn.softmax_cross_entropy_with_logits(logits=conf,labels=y))
optimizer = tf.train.AdamOptimizer(learning_rate=self.cfg.g("adam_learning_rate")).minimize(cost)
评论列表
文章目录