Change shard size when converting keras model to tfjs for react-native

Viewed 230

I'm trying to convert a keras model into tensorflowjs so that it can be run with react-native.

React-native seems to only support tfjs models that have 1 shard.

Is there anyway to combine my shards into 1 shard, or change the shard size when converting so that I only end up with one shard?

1 Answers

It is possible to specify the shard file size. The bigger is the size, the less number of files, there will be. The shard file size can be specified with the option --weight_shard_size_bytes of tfjs_converter

Related