I am working for a project of semantic segmentation of retinal blood vessels with Tensorflow with the MobileUNet model and I have received this error:
InvalidArgumentError (see above for traceback): logits and labels must
be broadcastable: logits_size=[82944,2] labels_size=[90000,2]
[[Node: softmax_cross_entropy_with_logits_sg = SoftmaxCrossEntropyWithLogits[T=DT_FLOAT,
_device="/job:localhost/replica:0/task:0/device:CPU:0"](softmax_cross_entropy_with_logits_sg/Reshape,
softmax_cross_entropy_with_logits_sg/Reshape_1)]]
Here my code is as follows:
network=network = build_mobile_unet(net_input, preset_model = args.model, num_classes=num_classes)
net_input = tf.placeholder(tf.float32,shape=[None,None,None,3])
net_output = tf.placeholder(tf.float32,shape=[None,None,None,num_classes])
losses = tf.nn.softmax_cross_entropy_with_logits(logits=network, labels=net_output)
cost = tf.reduce_mean(losses)
opt = tf.train.AdamOptimizer(0.001).minimize(cost)
init = tf.initialize_all_variables() _,current=sess.run([opt,cost],feed_dict={net_input:input_image_batch, net_output:segmented_image_batch})
The input image is 300x300
, and is in the RGB colour-space. The output is a binary image with the same size as input.
Can someone help me?