问题
I just trained a Google Auto ML Vision model and exported as TensorFlowJS to implement it in React Native. The Problem I am facing: Google splits the weights into 6 different shard*.bin files. As it is a graph model, I can't use the tensorflowjs_converter to leverage the --weight_shard_size_bytes setting. I did not find any other way to import it into my React Native app than by using the BundleResourcesIO function which needs one bin file. The model should be bundled locally. Does anyone have suggestion how to merge these bin files into one? I am pretty out of options.
Thank you!
回答1:
Thanks @Ryan Lin Xiang, for sharing the solution. For the benefit of community I am providing solution here (answer section).
Used
cat
in Terminal to merge the six bin files in Mac.
To combine several text files into a single file in Unix, use the cat
command as below
cat file1 file2 file3 > newfile
来源:https://stackoverflow.com/questions/62579876/how-to-merge-shard-bin-files-into-one