LZQthePlane / Online-Realtime-Action-Recognition-based-on-OpenPose

A skeleton-based real-time online action recognition project, classifying and recognizing base on framewise joints, which can be used for safety surveilence.
Apache License 2.0
671 stars 232 forks source link

KeyError: "The name 'net/images:0' refers to a Tensor which does not exist. The operation, 'net/images', does not exist in the graph." #68

Open hjl-2548951848 opened 3 years ago

hustxxj commented 3 years ago

I have the same problem

whwtraffic12306 commented 3 years ago

I have the same problem "graph." % (repr(name), repr(op_name))) KeyError: "The name 'net/images:0' refers to a Tensor which does not exist. The operation, 'net/images', does not exist in the graph."

CharlesJames13586 commented 3 years ago

请问你们邮解决这个问题吗

taureanamir commented 3 years ago

What version of tensorflow are you guys using? the issue might be due to mismatch in the version of TF that the model is built and the one that you are using.

zhaojunjie-123 commented 3 years ago

张量不一样了,把net/去掉就可以了

taureanamir commented 3 years ago

Replace the following lines in the generate_detections.py wlth the ones below.

self.input_var = tf.compat.v1.get_default_graph().get_tensor_by_name("net/%s:0" % input_name)
self.output_var = tf.compat.v1.get_default_graph.get_tensor_by_name("net/%s:0" % output_name)
# For TF v2.0 and above
self.input_var = tf.compat.v1.get_default_graph().get_tensor_by_name( "%s:0" % input_name)
self.output_var = tf.compat.v1.get_default_graph().get_tensor_by_name( "%s:0" % output_name)

Basically just remove net/ in the API call.

Tracy-git commented 1 year ago

You could also do it like this.add follow line uner import tensorflow as tf ,tf.compat.v1.disable_eager_execution()