我曾尝试在TF Hub上测试ALBERT模型。当我试图从TF集线器加载ALBERT时,我得到了以下错误:
python
Python 3.6.8 (default, May 16 2019, 05:58:38)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-36.0.1)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow_hub as hub
>>> albert_module = hub.Module(
... "https://tfhub.dev/google/albert_base/1",
... trainable=True)
Traceback (most recent call last):
File "<stdin>", line 3, in <module>
File "/home/opc/vuh/tools/pyvenv3-gpu-tf-hub/lib64/python3.6/site-packages/tensorflow_hub/module.py", line 170, in __init__
tags=self._tags)
File "/home/opc/vuh/tools/pyvenv3-gpu-tf-hub/lib64/python3.6/site-packages/tensorflow_hub/native_module.py", line 340, in _create_impl
name=name)
File "/home/opc/vuh/tools/pyvenv3-gpu-tf-hub/lib64/python3.6/site-packages/tensorflow_hub/native_module.py", line 382, in __init__
op.name for op in self._meta_graph.meta_info_def.stripped_op_list.op})
File "/home/opc/vuh/tools/pyvenv3-gpu-tf-hub/lib64/python3.6/site-packages/tensorflow_hub/native_module.py", line 822, in register_ops_if_needed
% missing_ops.difference(set(cpp_registry_ops.keys())))
tensorflow.python.framework.errors_impl.NotFoundError: Graph ops missing from the python registry ({'BatchMatMulV2'}) are also absent from the c++ registry.有人知道为什么吗?提前感谢了这么多?
仅供参考,在我的python3 venv中,我使用:
tensorflow-datasets 1.1.0 tensorflow-estimator 1.13.0 tensorflow-gpu 1.13.1 tensorflow-hub 0.6.0 tensorflow-metadata 0.14.0 tensorflow-probability 0.7.0 tensorflow-probability 0.1.83句子摘要0.1.82
发布于 2021-06-09 21:11:45
看起来你回答了自己的问题,但为了让别人明白这一点:
您需要使用tensorflow >= 1.14.0。在旧版本的TF中不存在必要的op (BatchMatMulV2)。
https://stackoverflow.com/questions/58585668
复制相似问题