tensorflow / tfjs-wechat

WeChat Mini-program plugin for TensorFlow.js
https://tensorflow.org/js
552 stars 104 forks source link

save models to local storage and load from local #44

Closed iooops closed 4 years ago

iooops commented 4 years ago

Is your feature request related to a problem? Please describe. A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Loading models from the internet can be slow sometimes.

Describe the solution you'd like A clear and concise description of what you want to happen.

It would be great if users can save tf models to local storage and local it from local next time when they open the app.

Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.

/

Additional context Add any other context or screenshots about the feature request here.

There's an attempt here: https://github.com/mogoweb/wechat-tfjs-examples

pyu10055 commented 4 years ago

@iooops this is a good idea, I will explore the possibility of add wechat localStorage io handler.

pyu10055 commented 4 years ago

I have added save function to the GraphModel, and will provide a localStorageIO handler for WeChat shortly. I noticed WeChat localStorage has a size limit of 10MB, which means model cannot exceed the 10MB in total size. You will need to use quantization flag with conversion CLI to reduce the model total size.