yolo-v4-tf.keras
yolo-v4-tf.keras copied to clipboard
simple fix for grid_size in yolov4_head when using custom img_size
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!
Thank you!