user746317
user746317

Reputation: 35

Problem with ALBERT pretrained model on TF Hub

I've tried to test the ALBERT model on TF Hub. I got the following error when just trying to load ALBERT from TF Hub:

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.

Do anyone know why? Thanks so much in advance?

FYI, in my python3 venv, I am using:

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 tf-sentencepiece 0.1.83 sentencepiece 0.1.82

Upvotes: 0

Views: 480

Answers (1)

MorganR
MorganR

Reputation: 81

It looks like you answered your own question, but to make this more obvious for others:

You need to use tensorflow >= 1.14.0. The necessary op (BatchMatMulV2) was not present in older versions of TF.

Upvotes: 1

Related Questions