-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
where is yolov4full.tflite ? #47
Comments
Did you run convert_tflite.py? The repo doesn't come with the model. I had to download the yolov4 weights and then ran the below command to generate the tflite file. Hope this helps. python convert_tflite.py --weights ./data/yolov4.weights --output ./data/yolov4.tflite |
Thank you for your tip ! But the exported yolov4.tflite is 63040 KB. I think this is too large to intergrate into android app, it is not suitable and practical. |
That's about the size I got. Still less than the 240MB of the original model. You could try changing the optimizes on line 69 of convert_tflite.py from converter.optimizations = [tf.lite.Optimize.DEFAULT] to converter.optimizations = [tf.lite.Optimize.OPTIMIZE_FOR_SIZE]. Or try tiny the tiny version of YOLO. Not sure if weights are available or you will have to train your own though. |
Is
the first command line produce a more big tflite file which is 125,789 KB, the second command line has two errors: one is the --dataset path, another is after corect the dadaset path, the terminal report : RuntimeError: |
I have not tried optimize for size no. But thought it worth a try since it's an easy change. Full int8 quantization requires a representative dataset so it can find the full dynamic range of each activation. So you'll need data for that. However, I didn't suggest it for your case as I don't think it will result in a smaller file since all the weights are already 8 bit in the regular tflite file. Full int 8 makes all the activations 8 bit as well, as far as my understanding of it. |
@hunglc007 Can you update and fix the typo of #convert-to-tflite part |
Right, this is the file that points to where the files are located. The integers are the bounding boxes and the object class. I suggest studying on how YOLO works. There are tools that can help label your own images. Like Vott. Or there are existing labelled data sets. |
@sterlingrpi I got it !Thanks ! |
@sterlingrpi where did you put the .tflite file? |
I left it in the default data directory |
@sterlingrpi how does it perform on your phone? I installed on Google Pixel XL, it painfully slow |
@EuphoriaCelestial haven't tried on a phone. I'm running on RPi. But I can concur it is slow. You can try full int8 quantization and/or YOLO tiny. We are working on this in another thread. But it's a process #53 |
I tried to build and install this repo‘s android app, but it reports the error:
Caused by: java.lang.RuntimeException: java.io.FileNotFoundException: yolov4full.tflite
The text was updated successfully, but these errors were encountered: