Open speeding-motor opened 4 years ago
in frontend.py def custom_loss: true_box_xy, true_box_wh, coord_mask = tf.cond(tf.less(seen, self.warmup_batches+1), lambda: [true_box_xy + (0.5 + cell_grid) * no_boxes_mask, true_box_wh + tf.ones_like(true_box_wh) * \ np.reshape(self.anchors, [1, 1, 1, self.nb_box, 2]) * \ no_boxes_mask, tf.ones_like(coord_mask)], lambda: [true_box_xy, true_box_wh, coord_mask])
true_box_xy, true_box_wh, coord_mask = tf.cond(tf.less(seen, self.warmup_batches+1), lambda: [true_box_xy + (0.5 + cell_grid) * no_boxes_mask, true_box_wh + tf.ones_like(true_box_wh) * \ np.reshape(self.anchors, [1, 1, 1, self.nb_box, 2]) * \ no_boxes_mask, tf.ones_like(coord_mask)], lambda: [true_box_xy, true_box_wh, coord_mask])
why here need to do this , why not use true_box_wh = true_box_wh when seen < warmup_batches,
when I not use warmup_batches, the nan error occurred when training(error occured in tf.exp(pred_wh)),
can you please help me ,Thank you very much
in frontend.py
def custom_loss:
true_box_xy, true_box_wh, coord_mask = tf.cond(tf.less(seen, self.warmup_batches+1), lambda: [true_box_xy + (0.5 + cell_grid) * no_boxes_mask, true_box_wh + tf.ones_like(true_box_wh) * \ np.reshape(self.anchors, [1, 1, 1, self.nb_box, 2]) * \ no_boxes_mask, tf.ones_like(coord_mask)], lambda: [true_box_xy, true_box_wh, coord_mask])
why here need to do this , why not use true_box_wh = true_box_wh when seen < warmup_batches,
when I not use warmup_batches, the nan error occurred when training(error occured in tf.exp(pred_wh)),
can you please help me ,Thank you very much