-
Notifications
You must be signed in to change notification settings - Fork 263
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
Comments
Fixed by training my own model. |
@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 |
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 😄 |
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. |
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. |
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 ([email protected])? since downloading file on github is so slow in CN... |
Yes I think I can help you solve that, but maybe you should post this
question as a comment on that github issue. That way if someone has the
same problem it can stay there as a solution.
But long story short you have to change the default input size. The demo
model uses a picture of 300x300x3 and the face detection model expects an
input of 512x512x3
…On Wed, May 15, 2019 at 5:17 PM Sunnyche ***@***.***> wrote:
I use your float point model to build tensorflow demo android app. The app
build successfully, but it flash back. I use logcat command and see the
error message *‘Cannot convert between a TensorFlowLite buffer with
3145728 bytes and a ByteBuffer with 1080000 bytes.’*. In issue #42
<#42>, I
found you set the input tensor size as 512*512*3, but I set input tensor
size as 300*300*3 in my tflite file which worked in my android phone.
Have you come across this problem? if yes, what's the solution?
Thanks.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#54?email_source=notifications&email_token=AC2DOADRW5GFIM5CICONBTLPVQZRTA5CNFSM4HHIYVP2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODVPFVSI#issuecomment-492722889>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AC2DOABAOLRIK22YRGTUMM3PVQZRTANCNFSM4HHIYVPQ>
.
|
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. |
It's not a stupid question, I had a similar problem but I had noone to ask
for help. There might be someone in the future who would appreciate having
their "stupid" question already be asked by someone else
…On Thu, 16 May 2019, 01:42 Sunnyche, ***@***.***> wrote:
Sorry for deleting the comment. By change *TF_OD_API_INPUT_SIZE* variable
in there
<https://github.com/tensorflow/tensorflow/blob/ac6e97967698a9de32a04d48a4ef4b355f8c6e65/tensorflow/examples/android/src/org/tensorflow/demo/DetectorActivity.java>
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.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#54?email_source=notifications&email_token=AC2DOAGLHXIFNH3HNPQ4NLDPVSUV5A5CNFSM4HHIYVP2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODVQKPOY#issuecomment-492873659>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AC2DOAFTABU4QX2LGGFPJ7DPVSUV5ANCNFSM4HHIYVPQ>
.
|
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.
The text was updated successfully, but these errors were encountered: