yolo-v4-tf.keras icon indicating copy to clipboard operation
yolo-v4-tf.keras copied to clipboard

simple fix for grid_size in yolov4_head when using custom img_size

Open gajdosech2 opened this issue 4 years ago • 1 comments

There was an error when calling model.predict when using custom img_size other than 416x416:

Invalid argument:  Input to reshape is a tensor with _XX_ values, but the requested shape has _YY_
         [[node functional_9/tf_op_layer_Reshape_12/Reshape_12 (defined at ./yolo\models.py:115) ]]
         [[functional_9/tf_op_layer_Mul_89/Mul_89/_6]]

This is caused by the incompatibility of grid_size when calling get_boxes inside of yolov4_head. This is a simple fix I use in my fork, which scales the grid_size accordingly to the custom img_size. Merge if you find it suitable.

BTW @taipingeric thank you for your work!

gajdosech2 avatar Feb 22 '21 21:02 gajdosech2

Thank you!

remingm avatar Jan 20 '23 21:01 remingm