Open exipilis opened 6 years ago
You should change that part of code in this way:
cell_x = tf.to_float(tf.reshape(tf.tile(tf.range(GRID_W), [GRID_H]), (1, GRID_H, GRID_W, 1, 1)))
cell_y = tf.to_float(tf.reshape(tf.tile(tf.range(GRID_H), [GRID_W]), (1, GRID_W, GRID_H, 1, 1)))
cell_y = tf.transpose(cell_y, (0,2,1,3,4))
cell_grid = tf.tile(tf.concat([cell_x,cell_y], -1), [BATCH_SIZE, 1, 1, BOX, 1])
So we get a grid where every cell keeps cell's coordinates. It will work with squaresd grid too
it is working in my repo, you can check it here. I did something very similiar from what @evgevd said
Nope @rodrigo2019 still the same error with your fork
This code fails if you try setting grid_w and grid_h with different values, for example, you decided to use Yolo for images which are not square:
https://github.com/experiencor/keras-yolo2/blob/master/frontend.py#L92