Hello.
I try to convert the opennmt tensforflow model to ctranslate2 model.
However the below error is occur.
How to solve the problem?
Thanks.
WARNING:tensorflow:From /usr/local/lib/python3.6/dist-packages/ctranslate2/converters/opennmt_tf.py:70: load (from tensorflow.python.saved_model.loader_impl) is deprecated and will be removed in a future version.
Instructions for updating:
This function will only be available through the v1 compatibility library as tf.compat.v1.saved_model.loader.load or tf.compat.v1.saved_model.load. There will be a new function for importing SavedModels in Tensorflow 2.0.
Traceback (most recent call last):
File “/usr/local/bin/ct2-opennmt-tf-converter”, line 8, in
sys.exit(main())
File “/usr/local/lib/python3.6/dist-packages/ctranslate2/bin/opennmt_tf_converter.py”, line 19, in main
tgt_vocab=args.tgt_vocab).convert_from_args(args)
File “/usr/local/lib/python3.6/dist-packages/ctranslate2/converters/converter.py”, line 40, in convert_from_args
force=args.force)
File “/usr/local/lib/python3.6/dist-packages/ctranslate2/converters/converter.py”, line 56, in convert
src_vocab, tgt_vocab = self._load(model_spec)
File “/usr/local/lib/python3.6/dist-packages/ctranslate2/converters/opennmt_tf.py”, line 117, in _load
tgt_vocab=self._tgt_vocab)
File “/usr/local/lib/python3.6/dist-packages/ctranslate2/converters/opennmt_tf.py”, line 70, in load_model
meta_graph = tf.compat.v1.saved_model.loader.load(sess, [“serve”], model_path)
File “/usr/local/lib/python3.6/dist-packages/tensorflow_core/python/util/deprecation.py”, line 324, in new_func
return func(*args, **kwargs)
File “/usr/local/lib/python3.6/dist-packages/tensorflow_core/python/saved_model/loader_impl.py”, line 269, in load
return loader.load(sess, tags, import_scope, **saver_kwargs)
File “/usr/local/lib/python3.6/dist-packages/tensorflow_core/python/saved_model/loader_impl.py”, line 422, in load
**saver_kwargs)
File “/usr/local/lib/python3.6/dist-packages/tensorflow_core/python/saved_model/loader_impl.py”, line 352, in load_graph
meta_graph_def, import_scope=import_scope, **saver_kwargs)
File “/usr/local/lib/python3.6/dist-packages/tensorflow_core/python/training/saver.py”, line 1477, in _import_meta_graph_with_return_elements
**kwargs))
File “/usr/local/lib/python3.6/dist-packages/tensorflow_core/python/framework/meta_graph.py”, line 809, in import_scoped_meta_graph_with_return_elements
return_elements=return_elements)
File “/usr/local/lib/python3.6/dist-packages/tensorflow_core/python/util/deprecation.py”, line 507, in new_func
return func(*args, **kwargs)
File “/usr/local/lib/python3.6/dist-packages/tensorflow_core/python/framework/importer.py”, line 405, in import_graph_def
producer_op_list=producer_op_list)
File “/usr/local/lib/python3.6/dist-packages/tensorflow_core/python/framework/importer.py”, line 501, in _import_graph_def_internal
graph._c_graph, serialized, options) # pylint: disable=protected-access
tensorflow.python.framework.errors_impl.NotFoundError: Op type not registered ‘Addons>GatherTree’ in binary running on 35533ddd7f06. 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.