How to merge shard bin files into one

ぐ巨炮叔叔 提交于 2021-01-28 18:22:41

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!