TypechoJoeTheme

半醉残影

统计
文章目录

[常见错误]TensorFlow模型量化protobuf大小限制

2018-12-19
/
0 评论
/
608 阅读
/
正在检测是否收录...
12/19

前言

在做TensorFlow模型量化过程中,会用到transform_graph,然后在进行模型压缩时候因为自己的模型有1.7GB,所以程序报错。
[libprotobuf ERROR external/protobuf_archive/src/google/protobuf/io/coded_stream.cc:190] A protocol message was rejected because it was too big (more than 1073741824 bytes). To increase the limit (or to disable these warnings), see CodedInputStream::SetTotalBytesLimit() in google/protobuf/io/coded_stream.h.

解决办法

  1. 修改代码
$ vim tensorflow/core/platform/env.cc

找到coded_stream.SetTotalBytesLimit(1024LL << 20, 512LL << 20);

coded_stream.SetTotalBytesLimit(INT_MAX, INT_MAX);

然后修改参数即可

  1. 重新编译
$ bazel build tensorflow/tools/graph_transforms:transform_graph
TensorFlow深度学习
朗读
赞(0)
赞赏
感谢您的支持,我会继续努力哒!

三合一收款

下面三种方式都支持哦

微信
QQ
支付宝
打开支付宝/微信/QQ扫一扫,即可进行扫码打赏哦
版权属于:

半醉残影

本文链接:

https://blog.dengyb.com/archives/46/(转载时请注明本文出处及文章链接)

评论 (0)