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

Feature Request: adding class_weights to tfLite Model Maker #48703

Open
pdubz-sudo opened this issue Apr 22, 2021 · 2 comments
Open

Feature Request: adding class_weights to tfLite Model Maker #48703

pdubz-sudo opened this issue Apr 22, 2021 · 2 comments
Assignees
Labels
comp:lite-support Lite support library related issues TFLiteModelMaker TFLite Model Maker related issues type:feature Feature requests

Comments

@pdubz-sudo
Copy link

pdubz-sudo commented Apr 22, 2021

Description of issue (what needs changing):

It would be great if somebody could add class_weights to the model maker .create() arguments because it's pretty common to work with imbalanced datasets in real life. I'm trying to retrain a model with model maker for image classification and have about 15 labels with very different balances in classes. I'm trying to change the code myself and hoping to do a pull request but I can't my code to work.

Clear description

For example, why should someone use this method? How is it useful?
Many datasets are imbalanced and having class_weights in the .create() method will help a lot to tackle that issue.

Correct links

https://github.com/tensorflow/examples/tree/master/tensorflow_examples/lite/model_maker/core/task

Parameters defined

Description which could be added.
class_weight: : Optional dictionary mapping class indices (integers) to a
weight (float) value, used for weighting the loss function
(during training only). This can be useful to tell the model to
"pay more attention" to samples from an under-represented class.

Are you planning to also submit a pull request to fix the issue? See the docs

I'm trying to fix it myself and would like to do a pull request but my build never works after I changed the code. I've been trying to fix it for a while and finally just figured I should see if somebody else knows how to do it.

@abattery abattery added comp:lite-support Lite support library related issues type:feature Feature requests labels Apr 22, 2021
@abattery
Copy link
Contributor

@lintian06 could you review this feature request?

@pdubz-sudo
Copy link
Author

@lintian06 I changed some code which I think adds the feature. If you're interested, maybe you could check my code? I'm not sure if it works because I can't build from source when I follow the instructions from the model_maker readme (not sure why that is). This is the PR I made tensorflow/examples#307

@UsharaniPagadala UsharaniPagadala removed their assignment May 12, 2021
@pjpratik pjpratik added the TFLiteModelMaker TFLite Model Maker related issues label Jun 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp:lite-support Lite support library related issues TFLiteModelMaker TFLite Model Maker related issues type:feature Feature requests
Projects
None yet
Development

No branches or pull requests

5 participants