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

[tfjs-models/deeplab] why do we not have a save method in class SemanticSegmentation (to save the model in localstorage/indexdb) #8486

Open
cu8code opened this issue Dec 27, 2024 · 2 comments

Comments

@cu8code
Copy link

cu8code commented Dec 27, 2024

System Information

  • TensorFlow.js version: 4.22.0
  • Are you willing to contribute: Yes

Feature Request Description
I propose adding a save method to the SemanticSegmentation here class. Currently, I use a workaround where I save the model to IndexedDB after loading it. Here's my implementation:

let graphModel = null;
try {
    console.log("loading from memory");
    graphModel = await tfjs.loadGraphModel('indexeddb://deep');
    console.log("loaded from memory");
} catch (e) {
    console.log("failed to load from memory, loading from network");
    graphModel = await tfconv.loadGraphModel(
        modelConfig.modelUrl ||
        getURL(modelConfig.base!, modelConfig.quantizationBytes!)
    );
    console.log("saving to memory");
    graphModel.save("indexeddb://deep");
}

Impact on Current API
This addition would simplify workflows for browser-based applications.

Target Audience
Users running TensorFlow.js in the browser.

@cu8code cu8code added the type:feature New feature or request label Dec 27, 2024
@shmishra99 shmishra99 self-assigned this Jan 5, 2025
@shmishra99
Copy link
Contributor

Hi @cu8code ,

Thanks for the feature request. tfjs-models provide pre-trained models and direct APIs for making predictions. The reason why not all TFJS APIs are available in the model repository is because this repository focuses on simplifying prediction for users. However, you can still leverage TFJS APIs (like the .save method) in conjunction with tfjs-models.

Could you please elaborate further on how this would benefit the community?

Let me know if i have missed anything. Thank You!!

Copy link

This issue has been marked stale because it has no recent activity since 7 days. It will be closed if no further activity occurs. Thank you.

@github-actions github-actions bot added the stale label Jan 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants