这篇文章关注我关于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团队!