You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import tensorflow as tf
import tensorflow_recommenders_addons as tfra
m = tf.saved_model.load("1617949817")
Error message:
Traceback (most recent call last):
File "/Users/dxwang/repo/pycharm-repo/tensorflow-2.0-demo/com/opensource/demo/tftrt/demo.py", line 4, in <module>
m = tf.saved_model.load("1617949817")
File "/Users/dxwang/opt/anaconda3/envs/tfra/lib/python3.6/site-packages/tensorflow/python/saved_model/load.py", line 859, in load
return load_internal(export_dir, tags, options)["root"]
File "/Users/dxwang/opt/anaconda3/envs/tfra/lib/python3.6/site-packages/tensorflow/python/saved_model/load.py", line 909, in load_internal
root = load_v1_in_v2.load(export_dir, tags)
File "/Users/dxwang/opt/anaconda3/envs/tfra/lib/python3.6/site-packages/tensorflow/python/saved_model/load_v1_in_v2.py", line 279, in load
return loader.load(tags=tags)
File "/Users/dxwang/opt/anaconda3/envs/tfra/lib/python3.6/site-packages/tensorflow/python/saved_model/load_v1_in_v2.py", line 225, in load
signature=[])
File "/Users/dxwang/opt/anaconda3/envs/tfra/lib/python3.6/site-packages/tensorflow/python/eager/wrap_function.py", line 628, in wrap_function
collections={}),
File "/Users/dxwang/opt/anaconda3/envs/tfra/lib/python3.6/site-packages/tensorflow/python/framework/func_graph.py", line 990, in func_graph_from_py_func
func_outputs = python_func(*func_args, **func_kwargs)
File "/Users/dxwang/opt/anaconda3/envs/tfra/lib/python3.6/site-packages/tensorflow/python/eager/wrap_function.py", line 87, in __call__
return self.call_with_variable_creator_scope(self._fn)(*args, **kwargs)
File "/Users/dxwang/opt/anaconda3/envs/tfra/lib/python3.6/site-packages/tensorflow/python/eager/wrap_function.py", line 93, in wrapped
return fn(*args, **kwargs)
File "/Users/dxwang/opt/anaconda3/envs/tfra/lib/python3.6/site-packages/tensorflow/python/saved_model/load_v1_in_v2.py", line 93, in load_graph
meta_graph_def)
File "/Users/dxwang/opt/anaconda3/envs/tfra/lib/python3.6/site-packages/tensorflow/python/training/saver.py", line 1485, in _import_meta_graph_with_return_elements
**kwargs))
File "/Users/dxwang/opt/anaconda3/envs/tfra/lib/python3.6/site-packages/tensorflow/python/framework/meta_graph.py", line 886, in import_scoped_meta_graph_with_return_elements
ops.prepend_name_scope(value, scope_to_prepend_to_names))
File "/Users/dxwang/opt/anaconda3/envs/tfra/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 3726, in as_graph_element
return self._as_graph_element_locked(obj, allow_tensor, allow_operation)
File "/Users/dxwang/opt/anaconda3/envs/tfra/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 3786, in _as_graph_element_locked
"graph." % repr(name))
KeyError: "The name 'deep_dynamic_embeddings' refers to an Operation not in the graph."
The text was updated successfully, but these errors were encountered:
I got the same error when export graph meta to file and try to import the meta. And seems the trace to variables stops at a collection_def value to the variable. Since the de.Variable class do not hold any tensor, so the meta graph tells tensorflow that you should restore a tensor name as "deep_dynamic_embeddings" but actually it does not exist.
Currently, I'm trying to find a method to avoid dumping de.Variable in meta graph file.
Would you please switch to tensorflow-recommenders-addons>=0.3.0? I think it may help. The issue is caused by graph keys, which were introduced to the saved model. The new version removed the legacy keys by default.
Environment description:
The text was updated successfully, but these errors were encountered: