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
KeyError: "The name 'deepspeech/logits:0' refers to a Tensor which does not exist. The operation, 'deepspeech/logits', does not exist in the graph."
#121
Closed
Hybrogen opened this issue
Jun 19, 2023
· 1 comment
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ [] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Traceback (most recent call last):
File "D:\HWork\NEW08\AD-NeRF\data_util\deepspeech_features\extract_ds_features.py", line 128, in<module>main()
File "D:\HWork\NEW08\AD-NeRF\data_util\deepspeech_features\extract_ds_features.py", line 120, in main
extract_features(
File "D:\HWork\NEW08\AD-NeRF\data_util\deepspeech_features\extract_ds_features.py", line 80, in extract_features
conv_audios_to_deepspeech(
File "D:\HWork\NEW08\AD-NeRF\data_util\deepspeech_features\deepspeech_features.py", line 41, in conv_audios_to_deepspeech
graph, logits_ph, input_node_ph, input_lengths_ph = prepare_deepspeech_net(
File "D:\HWork\NEW08\AD-NeRF\data_util\deepspeech_features\deepspeech_features.py", line 106, in prepare_deepspeech_net
logits_ph = graph.get_tensor_by_name("deepspeech/logits:0")
File "D:\HPrograms\H_OnInstall\Python\Python310\lib\site-packages\tensorflow\python\framework\ops.py", line 4188, in get_tensor_by_name
return self.as_graph_element(name, allow_tensor=True, allow_operation=False)
File "D:\HPrograms\H_OnInstall\Python\Python310\lib\site-packages\tensorflow\python\framework\ops.py", line 4012, in as_graph_element
return self._as_graph_element_locked(obj, allow_tensor, allow_operation)
File "D:\HPrograms\H_OnInstall\Python\Python310\lib\site-packages\tensorflow\python\framework\ops.py", line 4052, in _as_graph_element_locked
raise KeyError("The name %s refers to a Tensor which does not "
KeyError: "The name 'deepspeech/logits:0' refers to a Tensor which does not exist. The operation, 'deepspeech/logits', does not exist in the graph."
i find this error in ops.py and find out this:
# line 4049ifop_nameinself._nodes_by_name:
op=self._nodes_by_name[op_name]
else:
raiseKeyError("The name %s refers to a Tensor which does not ""exist. The operation, %s, does not exist in the ""graph."% (repr(name), repr(op_name)))
so i try to print [tensor.name for tensor in graph._nodes_by_name] before logits_ph = graph.get_tensor_by_name("deepspeech/logits:0") in deepspeech_features.py.
but it is empty. i wonder why and how to fix it~
The text was updated successfully, but these errors were encountered:
find out reason is that the version of tensorflow which origin project used is 1.15.2, but new version has some different.
anyway this change will be solve:
# data_util/deepspeech_features/deepspeech_features.pydefprepare_deepspeech_net(deepspeech_pb_path):
# Load graph and place_holders:withtf.io.gfile.GFile(deepspeech_pb_path, "rb") asf:
graph_def=tf.compat.v1.GraphDef()
graph_def.ParseFromString(f.read())
graph=tf.compat.v1.get_default_graph()
tf.import_graph_def(graph_def, name="deepspeech")
# check all graphs# print('~'*50, [tensor for tensor in graph._nodes_by_name], '~'*50)# print('~'*50, [tensor.name for tensor in graph.get_operations()], '~'*50)# i modifiedlogits_ph=graph.get_tensor_by_name("logits:0")
input_node_ph=graph.get_tensor_by_name("input_node:0")
input_lengths_ph=graph.get_tensor_by_name("input_lengths:0")
# original# logits_ph = graph.get_tensor_by_name("deepspeech/logits:0")# input_node_ph = graph.get_tensor_by_name("deepspeech/input_node:0")# input_lengths_ph = graph.get_tensor_by_name("deepspeech/input_lengths:0")returngraph, logits_ph, input_node_ph, input_lengths_ph
error:
i find this error in
ops.py
and find out this:so i try to print
[tensor.name for tensor in graph._nodes_by_name]
beforelogits_ph = graph.get_tensor_by_name("deepspeech/logits:0")
indeepspeech_features.py
.but it is empty. i wonder why and how to fix it~
The text was updated successfully, but these errors were encountered: