hub icon indicating copy to clipboard operation
hub copied to clipboard

tensorflow.python.framework.errors_impl.NotFoundError: Graph ops missing from the python registry ({'Einsum'}) are also absent from the c++ registry.

Open ntaherkhani opened this issue 7 years ago • 11 comments

I am trying to creat tensorflow-hub Module using locally saved ALBER pre-trained model and I am getting this error : tensorflow.python.framework.errors_impl.NotFoundError: Graph ops missing from the python registry ({'Einsum'}) are also absent from the c++ registry. I have: tensorflow: 1.14.0 tensorflow-hub: 0.7.0 opt-einsum= 3.1.0 I am working on MAC OS High Sierra 10.13.6

ntaherkhani avatar Nov 15 '19 19:11 ntaherkhani

In order to expedite the trouble-shooting process, please provide a code snippet to reproduce the issue reported here. Thanks!

rmothukuru avatar Nov 18 '19 05:11 rmothukuru

@rmothukuru thanks for your response. this is the code for creating module: import tensorflow_hub as hub import tensorflow as tf embed= hub.Module(“/path/to/saved/locally/pre-trained/ALBERT/Model/ALBERT_xxlarge")

this is the error that I got Traceback (most recent call last): File "/Users/……/python/helpers/pydev/pydevd.py", line 1741, in main() File "/Users/……/python/helpers/pydev/pydevd.py", line 1735, in main globals = debugger.run(setup['file'], None, None, is_module) File "/Users/……/python/helpers/pydev/pydevd.py", line 1135, in run pydev_imports.execfile(file, globals, locals) # execute the script File "/Users/……/python/helpers/pydev/_pydev_imps/_pydev_execfile.py", line 18, in execfile exec(compile(contents+"\n", file, 'exec'), glob, loc) File "/Users/…….py", line 3, in embed= hub.Module("/Users/……/Pretrain models/ALBERT/ALBERT_xxlarge") File "/Users/……/lib/python3.6/site-packages/tensorflow_hub/module.py", line 176, in init tags=self._tags) File "/Users/……/lib/python3.6/site-packages/tensorflow_hub/native_module.py", line 386, in _create_impl name=name) File "/Users/……/lib/python3.6/site-packages/tensorflow_hub/native_module.py", line 428, in init op.name for op in self._meta_graph.meta_info_def.stripped_op_list.op}) File "/Users/……/lib/python3.6/site-packages/tensorflow_hub/native_module.py", line 858, in register_ops_if_needed "the c++ registry." % missing_ops) tensorflow.python.framework.errors_impl.NotFoundError: Graph ops missing from the python registry ({'Einsum'}) are also absent from the c++ registry.

I downloaded pre-trained ALBERT model from: https://tfhub.dev/google/albert_xxlarge/2?tf-hub-format=compressed

thanks.

ntaherkhani avatar Nov 18 '19 13:11 ntaherkhani

Could reproduce the error with TF Version 1.14, TF Hub Version 0.7 and opt-einsum version 3.1.0. Here is the Gist. Thanks!

rmothukuru avatar Nov 19 '19 04:11 rmothukuru

@ntaherkhani Thanks for using TF Hub!

Adding an import statement to import numpy appears to fix the immediate issue -- see this Gist.

Please take a look and comment back on this thread in case that doesn't fix the issue.

j-grimstad avatar Nov 19 '19 13:11 j-grimstad

@j-grimstad thanks for your response . I imported numpy but didnt help.

ntaherkhani avatar Nov 19 '19 13:11 ntaherkhani

@ntaherkhani

Turns out this model only works with TF 1.15 installed -- see Gist.

I'll get in contact with the model owner to make sure this is clear in the model documentation going forward. Please let me know if this fixes the issue.

j-grimstad avatar Nov 19 '19 14:11 j-grimstad

@j-grimstad thanks for your solution. I upgraded my Tensorflow to 1.15 and it is working now and I can create hub Module for pre-trained ALBERT V1 and V2 models. however, when I am trying to embed the textual data and create feature vector using following code: embeddings=embed(["sample of textual data."]) I am getting error "ValueError: Signature 'default' is missing from meta graph."

ntaherkhani avatar Nov 19 '19 15:11 ntaherkhani

@ntaherkhani

Take a closer look at the "Example Use" section in https://tfhub.dev/google/albert_xxlarge/2, specifically, you'll need to specify signatures='tokens'.

The longer form demonstration also is useful (see beginning line 54 for where to specify signature='tokens' within the larger workflow): https://github.com/google-research/google-research/blob/master/albert/run_classifier_with_tfhub.py

I'll close this bug for now, since you're running into intended errors thus far -- if you need help with error troubleshooting, you'll likely receive timelier responses on StackOverflow.

j-grimstad avatar Dec 02 '19 15:12 j-grimstad

use tensorflow version 1.15

DarrVeter avatar Dec 06 '19 11:12 DarrVeter

@ntaherkhani Were you able to resolve this issue ? Cant seem to find a solution for this. I tried adding signature='tokens' but it gives me a "Signature expects multiple inputs. Use a dict." error

Shivan11 avatar Oct 28 '20 16:10 Shivan11

I'm running tensorflow 1.15.4 via Docker and still get this error

Note that I do have to install tensorflow hub outside of this to run it at all.

valexandersaulys avatar Nov 28 '20 20:11 valexandersaulys