Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Full YoloV3 model #6

Open
sathibault opened this issue Jul 11, 2020 · 5 comments
Open

Full YoloV3 model #6

sathibault opened this issue Jul 11, 2020 · 5 comments

Comments

@sathibault
Copy link

I'm wondering if you have tried building the full model (not tiny) for the Edge TPU?

@raryanpur
Copy link

@guichristmann would also be interested to know whether you've tried this.

@ownbee
Copy link

ownbee commented Sep 16, 2020

Took me some time to figure it out but now I have built the full model using the instructions with some tweaks. In the keras-yolo3 repo linked in the README, I changed activation=leaky to activation=relu in the non-tiny config file. Then created the keras-model.h5 with the convert.py script (no modification in this script) and used the keras_to_tflite_quant.py (no modification in this script either) to create the .tflite file.

With the latest tensorflow (2.3.0) and keras from pip, edgetpu_compiler failed to compile all operations so I downgraded tensorflow to 2.1.0 and keras to 2.3.1 (both were needed) and voilà:

edgetpu_compiler -s yolov3.tflite 
Edge TPU Compiler version 14.1.317412892

Model compiled successfully in 5155 ms.

Input model: yolov3.tflite
Input size: 60.00MiB
Output model: yolov3_edgetpu.tflite
Output size: 60.16MiB
On-chip memory used for caching model parameters: 6.81MiB
On-chip memory remaining for caching model parameters: 9.25KiB
Off-chip memory used for streaming uncached model parameters: 52.54MiB
Number of Edge TPU subgraphs: 1
Total number of operations: 113
Operation log: yolov3_edgetpu.log

Operator                       Count      Status

RESIZE_NEAREST_NEIGHBOR        2          Mapped to Edge TPU
CONCATENATION                  2          Mapped to Edge TPU
PAD                            5          Mapped to Edge TPU
ADD                            23         Mapped to Edge TPU
CONV_2D                        75         Mapped to Edge TPU
QUANTIZE                       6          Mapped to Edge TPU

I used the tensorflow docker image tensorflow/tensorflow:2.1.0-gpu-py3 (with nvidia-docker-runtime and installed keras in it).

Does it work on the tpu? Does it have good performance? I don't know, I have not yet run any inference with it but I will as soon as I have time...

@raryanpur
Copy link

@idittansikte awesome! Very interested in your results with respect to whether it runs on the tpu and the performance.

@ownbee
Copy link

ownbee commented Sep 18, 2020

@raryanpur I've tried it now and it loads on the edge with no errors, but I don't get any detections if i dont lower the threshold to 0. Then I get some crap out but nothing that can be used for anything. I was thinking if I need to retrain the weigths for relu.

The good news is I guess that it seem to load the model.

@anuragkarwa001
Copy link

@raryanpur I've tried it now and it loads on the edge with no errors, but I don't get any detections if i dont lower the threshold to 0. Then I get some crap out but nothing that can be used for anything. I was thinking if I need to retrain the weigths for relu.

The good news is I guess that it seem to load the model.

Any progress on this, I am facing the same problem. Model is not giving me any detections after inference on edge tpu

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants