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

Convert to tflite #54

Closed
Sunnycheey opened this issue Apr 20, 2019 · 10 comments
Closed

Convert to tflite #54

Sunnycheey opened this issue Apr 20, 2019 · 10 comments

Comments

@Sunnycheey
Copy link

Sunnycheey commented Apr 20, 2019

I try to convert .pb file to .tflite file so that I can deploy the model to android.

But when I try to use tflite_convert to do the convert, it failed. Then, I follow the instruction here which indicates that ckpt file is needed to generate .pb and then .tflite(But in this repo only pb file was offered).

I also try to use the code here to do the 'pb to ckpt' transform, but when I try to use the generated ckpt file to genrate .pb file, I failed again.

So can you offer the ckpt file, or can you indicate how to do the wider face dataset clean to train the model and get the ckpt file.

Thanks.

@Sunnycheey
Copy link
Author

Fixed by training my own model.

@fariagu
Copy link

fariagu commented Apr 26, 2019

@Sunnycheey I'm having the same problem you had, but I'm more used to working with keras, so the tflite_convert is also not working. Could you please explain how you generated the tflite file, or maybe even share the file itself? Thanks!

@Sunnycheey
Copy link
Author

@Sunnycheey I'm having the same problem you had, but I'm more used to working with keras, so the tflite_convert is also not working. Could you please explain how you generated the tflite file, or maybe even share the file itself? Thanks!

Have you solve your problem?

I can share my train process with you simply.

Firstly, you need write a small script to convert wider face database to tfrecord format, then you can train the model and get your own ckpt file. You can learn how to generate tfrecord in here and you can find pre-trained model in here

@fariagu
Copy link

fariagu commented May 7, 2019

Yes, I did fix it. Sorry for not updating.

I didn't train my own model, I followed the method described in the discussion of this issue (#42).

Thanks for replying though 😄

@Sunnycheey
Copy link
Author

To be honest, I try the solution decribed in the issue (#42), but I can't figure it out, so I train my own model. The problem is the test result of my own trained model is not as good as this repo. Have you finished the convert? Can you offered the tflite file itself?

Thanks.

@fariagu
Copy link

fariagu commented May 15, 2019

Sure thing. I can't say for sure how good the accuracy is but running on android the results are pretty decent.

The generated file is not quantized, though. Still haven't figured that part out.
detect.zip

@Sunnycheey
Copy link
Author

Well the generated file of my own trained model is quantized. Maybe floating point detect file can achieve more accuracy result but slower running speed. If you'd like to train your model, I can offer you some help. By the way, can you send the zip file directly to my email (lihuichaolihc@gmail.com)? since downloading file on github is so slow in CN...

@fariagu
Copy link

fariagu commented May 15, 2019 via email

@Sunnycheey
Copy link
Author

Sorry for deleting the comment. By change TF_OD_API_INPUT_SIZE variable in there from defalut 300 to 512, I solved the problem. I delete the comment since I think the problem is somewhat stupid to ask. The variable name explicitly tell me how to set the input tensor size.

Thanks anyway.

@fariagu
Copy link

fariagu commented May 16, 2019 via email

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

2 participants