Support for AutoML Vision Edge models with sharded weights in React Native
See original GitHub issueTensorFlow.js version
@tensorflow/tfjs : 1.7.3 @tensorflow/tfjs-react-native : 0.2.3
Browser version
expo : 37.0.8
Describe the problem or feature request
Since you:
- Can’t load sharded weights using the bundleResourceIO function provided in tfjs-react-native.
- Can’t run your own tensorflowjs conversion to change the
weight_shard_size_bytes
on a TF Saved Model exported from AutoML.
You get caught at an impasse when trying to use an AutoML Vision Edge model through the React Native APIs. It seems to me the options for someone with this issue are:
- Attain the ability to turn weight sharding off within AutoML’s Cloud UI.
- Attain a way to reproduce the exact
tensorflowjs_converter
command that AutoML runs on their end. Or however they make that conversion. - Attain a way to load multiple shards within the tfjs-react-native
bundleResourceIO
. - Attain a way to rejoin shards. I’m out of my depth, would that even be possible? I’ve experimented with taking non-sharded weights from my own conversion runs and splicing them into the model.json produced by AutoML with no luck.
Code to reproduce the bug / link to feature request
There’s not too much relevant code to show since it’s explicitly unsupported in tfjs-react-native. However, fwiw, here’s the conversion code I attempted to use when I realized direct support for the artifacts produced by AutoML tfjs export were not usable.
# This produces significantly different results than what is produced through the AutoML tfjs export.
tensorflowjs_converter \
--input_format=tf_saved_model \
--output_format=tfjs_graph_model \
--weight_shard_size_bytes=10485760 \
--skip_op_check \
00000123 \
test
Issue Analytics
- State:
- Created 3 years ago
- Comments:12 (6 by maintainers)
Top Results From Across the Web
Training Edge exportable models | AutoML Vision
You must create and train a new model to continue classifying content after that amount of time. Edge models are optimized for inference...
Read more >AutoML Vision Edge: Loading and Running a TensorFlow.js ...
This post is the 4th post in my series on Google Cloud's AutoML Vision Edge. The post will cover using the Tensorflow.js models...
Read more >Deploying Computer Vision Models: Tools & Best Practices
Automated ML in Azure supports model training for computer vision tasks like image classification, object detection, and instance segmentation. Authoring AutoML ...
Read more >react-native | Yarn - Package Manager
Getting Started · Learn the Basics · Showcase · Contribute · Community · Support. React Native brings React's declarative UI framework to iOS...
Read more >react-native-vector-icons directory
help -with-circle.. home.. hour-glass.. houzz ... low-vision.. viadeo.. viadeo-square ... weight-hanging.. weight.. wheelchair.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Closing, sharded models are now supported in tfjs-react-native https://github.com/tensorflow/tfjs/pull/4113
We also updates the instructions on the automl README to describe how to load a model with a custom IOHandler (i.e. something other than a string).
@tafsiri after thinking about this more, it might make sense to provide graph_model to graph_model conversion, the allowed features could include sharding and quantization. I will look into that.