微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

c – 关于量化的张量流量中的错误

这篇文章关注我关于op未注册的另一篇文章
NotFoundError: Op type not registered ‘Dequantize’

现在,当我尝试手动加载时,如下文所示:
Install Tensorflow with Quantization Support

有:

qops = tf.load_op_library('/home/artem/projects/tensorflow/bazel-bin/tensorflow/contrib/quantization/_quantized_ops.so')
qkernelops = tf.load_op_library('/home/artem/projects/tensorflow/bazel-bin/tensorflow/contrib/quantization/kernels/_quantized_kernels.so')

我收到以下错误

---------------------------------------------------------------------------
NotFoundError                             Traceback (most recent call last)
<ipython-input-4-799f99708cda> in <module>()
      1 
----> 2 qops = tf.load_op_library('/home/artem/projects/tensorflow/bazel-bin/tensorflow/contrib/quantization/_quantized_ops.so')
      3 qkernelops = tf.load_op_library('/home/artem/projects/tensorflow/bazel-bin/tensorflow/contrib/quantization/kernels/_quantized_kernels.so')

/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/load_library.pyc in load_op_library(library_filename)
     69           return _OP_LIBRARY_MAP[library_filename]
     70       # pylint: disable=protected-access
---> 71       raise errors._make_specific_exception(None, None, error_msg, error_code)
     72       # pylint: enable=protected-access
     73   finally:

NotFoundError: /home/artem/projects/tensorflow/bazel-bin/tensorflow/contrib/quantization/_quantized_ops.so: undefined symbol: _ZN10tensorflow8internal21CheckOpMessageBuilder9NewStringB5cxx11Ev

它看起来像是C编译器的一个问题,我可能应该在这文章添加-D_GLIBCXX_USE_CXX11_ABI = 0:
https://github.com/tensorflow/tensorflow/pull/1584

但实际上我做了bazel-build,我不知道如何管理它.

有人可以帮帮我吗?从https://www.tensorflow.org/versions/master/how_tos/quantization/index.html开始的测试示例也不起作用.
如果有人会写一些关于量化的详细手册,那将会很棒.

解决方法:

Tensorflow 0.10发布!我更新后解决了这个问题!
在脚本中添加这些代码

from tensorflow.contrib.quantization import load_quantized_ops_so
from tensorflow.contrib.quantization.kernels import load_quantized_kernels_so

load_quantized_ops_so.Load()
load_quantized_kernels_so.Load()

谢谢TF团队!

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐