thtrieu / darkflow

Translate darknet to tensorflow. Load trained weights, retrain/fine-tune using tensorflow, export constant graph def to mobile devices
GNU General Public License v3.0
6.14k stars 2.08k forks source link

Is it a bug in yolo/train.py? #487

Open gauss-clb opened 6 years ago

gauss-clb commented 6 years ago

Not every grid will contain an object, so one grid may predict no objects. But in yolo/train.py, tf.reduce_max(iou, [2], True) will return max value of two bbox even though the grid don't contain an object, and best_box = tf.equal(iou, tf.reduce_max(iou, [2], True)) will have at least one true for two bbox of each grid.

Do you agree with me ?

Ridhwanluthra commented 6 years ago

based on https://github.com/tensorflow/tensorflow/issues/3510 i think that tf.reduce_max return +3.4e+38 it wont be equal to iou in tf.equal operation hence we get a false and hence no bbox is selected. @thtrieu please correct me if i am wrong

gauss-clb commented 6 years ago

@Ridhwanluthra No, there is no tensors with zero-size dimension, if a grid don't contain an object, _upleft and _botright will be fed by zeros tensors, so iou must have value, tf.reduce_max must return value rather than +3.4e+38.