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

It became larger after converting to tflite model #278

Open
weinixuehao opened this issue Jan 20, 2024 · 4 comments
Open

It became larger after converting to tflite model #278

weinixuehao opened this issue Jan 20, 2024 · 4 comments
Labels
enhancement New feature or request question Further information is requested work-medium work that can be done within 1 day

Comments

@weinixuehao
Copy link

image
image

The ckpt file contains two model states so a single one is half the size.

I found that if the input resolution is larger the converted tflite model is larger

@peterjc123
Copy link
Collaborator

peterjc123 commented Jan 20, 2024

Q: What if duplicate tensors is generated in the TFLite model (e.g. when performing static quantization for LSTMs)?

A: You may try out group_tensors=True to remove those duplicates.

@weinixuehao
Copy link
Author

weinixuehao commented Jan 23, 2024

@peterjc123
After converting with group_tensors, it is still much larger and the inference result is wrong.
image

@peterjc123 peterjc123 added question Further information is requested enhancement New feature or request labels Jan 23, 2024
@peterjc123
Copy link
Collaborator

peterjc123 commented Jan 23, 2024

It was caused by the pattern. a = torch.cat((b, torch.zeros(...)), dim=...). We may write a optimizer pass for that.

@peterjc123 peterjc123 added the work-medium work that can be done within 1 day label Jan 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested work-medium work that can be done within 1 day
Projects
None yet
Development

No branches or pull requests

2 participants