tensorflow / addons

Useful extra functionality for TensorFlow 2.x maintained by SIG-addons
Apache License 2.0
1.69k stars 611 forks source link

tensorflow.python.framework.errors_impl.NotFoundError: Op type not registered 'GatherTree' in binary running #1893

Closed gyshi closed 4 years ago

gyshi commented 4 years ago

when i run gnmt with tf2.1, have this error . System information

Describe the bug

Traceback (most recent call last):
  File "/home/shiguang/models/benchmarks/../models/language_translation/tensorflow/mlperf_gnmt/fp32/run_inference.py", line 90, in <module>
    importer.import_graph_def(graph_def, input_map={}, name="")
  File "/home/shiguang/.local/lib/python3.7/site-packages/tensorflow/python/util/deprecation.py", line 507, in new_func
    return func(*args, **kwargs)
  File "/home/shiguang/.local/lib/python3.7/site-packages/tensorflow/python/framework/importer.py", line 405, in import_graph_def
    producer_op_list=producer_op_list)
  File "/home/shiguang/.local/lib/python3.7/site-packages/tensorflow/python/framework/importer.py", line 497, in _import_graph_def_internal
    graph._c_graph, serialized, options)  # pylint: disable=protected-access
tensorflow.python.framework.errors_impl.NotFoundError: Op type not registered 'GatherTree' in binary running on    . Make sure the Op and Kernel are registered in the binary running in this process. Note that if you are loading a saved graph which used ops from tf.contrib, accessing (e.g.) `tf.contrib.resampler` should be done before importing the graph, as contrib ops are lazily registered when the module is first accessed.
Ran inference with batch size 32

A clear and concise description of what the bug is.

Code to reproduce the issue

Provide a reproducible test case that is the bare minimum necessary to generate the problem.

Other info / logs

Include any logs or source code that would be helpful to diagnose the problem. If including tracebacks, please include the full traceback. Large logs and files should be attached.

bhack commented 4 years ago

Do you have a minimal code that could be copy and pasted to reproduce this error?

gyshi commented 4 years ago

Do you have a minimal code that could be copy and pasted to reproduce this error? i use this toturial https://github.com/IntelAI/models/tree/master/benchmarks/language_translation/tensorflow/mlperf_gnmt because my tensorflow is also 2.1, but have internal upgrade, so i have to use more higher version for addons to build tensorflow-addons success. when i run this model, i will meet this error.

seanpmorgan commented 4 years ago

Hmmm TFA 0.11 hasn't yet been released are you sure you're correct about the versions. FWIW TFA 0.10 requires TensorFlow >= 2.2 which could be causing this error.

gyshi commented 4 years ago

TensorFlow

now, i will try other version, if i will meet same error, i will connect you, thx.

gyshi commented 4 years ago

Hmmm TFA 0.11 hasn't yet been released are you sure you're correct about the versions. FWIW TFA 0.10 requires TensorFlow >= 2.2 which could be causing this error.

i have try tfa 0.7, i meet the same error.

guillaumekln commented 4 years ago

The op GatherTree has been renamed to Addons>GatherTree in TensorFlow Addons 0.6. You should re-export the SavedModel with a newer version of TensorFlow Addons.

gyshi commented 4 years ago

The op GatherTree has been renamed to Addons>GatherTree in TensorFlow Addons 0.6. You should re-export the SavedModel with a newer version of TensorFlow Addons.

thx

gyshi commented 4 years ago

The op GatherTree has been renamed to Addons>GatherTree in TensorFlow Addons 0.6. You should re-export the SavedModel with a newer version of TensorFlow Addons.

if i want to rename Addons>GatherTree to GatherTree , I only need to modify REGISTER_OP("GatherTree")?

gyshi commented 4 years ago

The op GatherTree has been renamed to Addons>GatherTree in TensorFlow Addons 0.6. You should re-export the SavedModel with a newer version of TensorFlow Addons.

@guillaumekln if i want to rename Addons>GatherTree to GatherTree , I only need to modify REGISTER_OP("GatherTree")?

guillaumekln commented 4 years ago

This would require to rebuild the TensorFlow Addons package.This is not something we recommend.

Instead, you should either install TensorFlow Addons < 0.6 or open an issue on https://github.com/IntelAI/models to ask the maintainers to republish the trained model.

gyshi commented 4 years ago

This would require to rebuild the TensorFlow Addons package.This is not something we recommend.

Instead, you should either install TensorFlow Addons < 0.6 or open an issue on https://github.com/IntelAI/models to ask the maintainers to republish the trained model.

thx for your help.