如何将碎片bin文件合并为一个 [英] How to merge shard bin files into one

查看:183
本文介绍了如何将碎片bin文件合并为一个的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚训练了一个Google Auto ML Vision模型,并导出为TensorFlowJS以在React Native中实现它.我面临的问题:Google将权重分为6个不同的shard * .bin文件.因为它是一个图形模型,所以我不能使用tensorflowjs_converter来利用--weight_shard_size_bytes设置.除了使用需要一个bin文件的BundleResourcesIO函数外,我没有找到其他任何将其导入到我的React Native应用程序中的方法.该模型应在本地捆绑.有人建议如何将这些bin文件合并为一个吗?我很没选择.

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.

谢谢!

推荐答案

感谢@Ryan Lin Xiang共享解决方案.为了社区的利益,我在此处提供解决方案(答案部分).

Thanks @Ryan Lin Xiang, for sharing the solution. For the benefit of community I am providing solution here (answer section).

在Terminal中使用 cat 合并Mac中的六个bin文件.

Used cat in Terminal to merge the six bin files in Mac.

要将 Unix 中的多个文本文件组合为单个文件,请使用cat 命令如下

To combine several text files into a single file in Unix, use the cat command as below

 cat file1 file2 file3 > newfile

这篇关于如何将碎片bin文件合并为一个的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆