-
Notifications
You must be signed in to change notification settings - Fork 75
Questions about v4 tiny on Edge TPU #20
Comments
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
My results are quite the opposite. I used the tiny_yolov4 with relu activation and weights provided by your repo. The input tensor has a size of (608, 608, 3). With the -a flag i get three subgraphs with 97 of 128 operations running on the tpu. Without the flag I have one subgraph with 42/128 operations mapped. This gives me the following inference times for 5 runs:
|
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
ModelEdgeTPU Ops: https://coral.ai/docs/edgetpu/models-intro/#supported-operations yolov4-tiny
yolo layer
EdgeTPUIn the current situation, not all layers are mapped to the TPU, because of We have to choose whether to change the model so that it can use TPU more or to give up some and run it on the CPU. When using TPU, I removed all operations from yolo except logistic. Converted modelIdentity - x0, Identity_1 - logistic(x0) FPS testModel only
In [9]: def model(x):
...: yolo._interpreter.set_tensor(yolo._input_details["index"], x)
...: yolo._interpreter.invoke()
...: # [yolo0, yolo1, ...]
...: # yolo == Dim(1, height, width, channels)
...: # yolo_tpu == x, logistic(x)
...:
...: return [
...: yolo._interpreter.get_tensor(output_detail["index"])
...: for output_detail in yolo._output_details
...: ]
...:
In [10]: 100/timeit.timeit(lambda: model(x), number=100)
Out[10]: 31.288735650288498 model + scale_x_y + copy x[..., wh] to logistic(x)[..., wh]tensorflow-yolov4/py_src/yolov4/tflite/__init__.py Lines 97 to 129 in b67ca45
In [14]: 100/timeit.timeit(lambda: yolo._predict(x), number=100)
Out[14]: 30.969583151128262 resize -> ... -> diounmstensorflow-yolov4/py_src/yolov4/common/base_class.py Lines 189 to 191 in b67ca45
24 ~ 29 FPS depending on the number of objects found. Plan
|
@hhk7734 what tpu you are using? |
@farhantandia Coral dev board |
@hhk7734 Very interesting to see v4 tiny on Edge TPU. I have two questions
Thanks
Originally posted by @ankandrew in #4 (comment)
The text was updated successfully, but these errors were encountered: