hhk7734 / tensorflow-yolov4

YOLOv4 Implemented in Tensorflow 2.
MIT License
136 stars 75 forks source link

yolov4-tiny-relu-new_coords-tpu on edgetpu too slow #82

Open alan303138 opened 3 years ago

alan303138 commented 3 years ago

I am using yolov4-tiny.weights with yolov4-tiny-relu-new_coords.cfg and using yolov4-tiny-relu-new_coords-tpu.cfg convert to tflite with compile. But the perform on the edgetpu is 60sec per image.

btw,the yolov4-tiny-relu.cfg and yolov4-tiny-relu-tpu.cfg on edgetpu is 0.18 per img.

Yolov4:v3.1.0 tf:2.4.1

hhk7734 commented 3 years ago

Would you share your tflite file?

alan303138 commented 3 years ago

Here

yolov4-tiny-relu-int8_edgetpu.zip

hhk7734 commented 3 years ago

The new_coords part is added in version 3.2.0.

https://github.com/hhk7734/tensorflow-yolov4/blob/3d31292cefba198b1528a90b3f435204efe7be73/CHANGELOG#L1-L9

and your model is the below. Perhaps you are not using the -a option. Ref: https://github.com/hhk7734/tensorflow-yolov4/issues/20#issuecomment-782882076

image

hhk7734 commented 3 years ago

yolov4-tiny-relu-tpu model outputs are 4, x1, logistic(x1), x2, logistic(x2). and yolov4-tiny-relut-new_coords outputs are 2, logistic(x1), logistic(x2). So ,in yolov4 3.1.0, if you try to predict new_coords, outputs are 2, but yolov4 try to find 4 outputs, because 3.1.0 don't know new_coords. Since the computational part is in C, the output difference could probably go beyond the allocated memory and cause problems with the system itself.