instance-segmentation-with-discriminative-loss-tensorflow
instance-segmentation-with-discriminative-loss-tensorflow copied to clipboard
l_dist term when instance_num=1
I am using you discriminative loss function for another use. And I discovered that if instance_num==1
, the l_dist
term will become nan
because mu_norm=[]
. So I suggest to add a sentence like l_dist = tf.cond(num_instances<=1, lambda:tf.zeros(1, dtype=tf.float32), lambda:tf.reduce_mean(mu_norm))
after the calculation of l_dist
term.
Do you think it's necessary? If so, may I add a pull request to your repo?
@AlbertHuyb I got a complaint about the tensor's shape using your command when instance_num==1
, changing from tf.zeros(1, dtype=tf.float32)
to tf.constant(0, dtype=tf.float32)
works for me