kshitij1489 / object-tracking

13 stars 6 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." #2

Open chrisTopp84 opened 3 years ago

chrisTopp84 commented 3 years ago

Hi kshitij1489,

I try to run your tracker _objecttracking.py but unfortunately am error occurs.

This is the error:

Traceback (most recent call last): File "object_tracking.py", line 12, in encoder = init_encoder() File "/home/nvidia/kshitij1489/object-tracking/deep_sort/person_id_model/generate_person_features.py", line 143, in init_encoder encoder = create_box_encoder(model_file, batch_size=1) File "/home/nvidia/kshitij1489/object-tracking/deep_sort/person_id_model/generate_person_features.py", line 96, in create_box_encoder image_encoder = ImageEncoder(model_filename, input_name, output_name) File "/home/nvidia/kshitij1489/object-tracking/deep_sort/person_id_model/generate_person_features.py", line 77, in init "net/%s:0" % input_name) File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/framework/ops.py", line 3846, in get_tensor_by_name return self.as_graph_element(name, allow_tensor=True, allow_operation=False) File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/framework/ops.py", line 3670, in as_graph_element return self._as_graph_element_locked(obj, allow_tensor, allow_operation) File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/framework/ops.py", line 3712, in _as_graph_element_locked "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."

Do you know what i can do to solve the problem?

I'm using scikit-learn-0.23.2 and had to do the following adjustments:

I replaced

from . import linear_assignment

by this

from scipy.optimize import linear_sum_assignment as linear_assignment

within the files _linear_assignment.py_ and _ioumatching.py

But i don't know if that matters.

BR chris

SiPi76 commented 3 years ago

change in generate_person_features.py :

self.input_var = tf.get_default_graph().get_tensor_by_name( "net/%s:0" % input_name) self.output_var = tf.get_default_graph().get_tensor_by_name( "net/%s:0" % output_name)

by :

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)

SiPi76 commented 2 years ago

Hey could you give me more details on what’s not working for you ?

On 25 Aug 2022, at 00:59, Timur Sarov @.***> wrote: Hi SiPi76 won't working for me, any thoughts?

saharacoderpl commented 1 year ago

After changing in generate_person_features.py I am getting

[h264 @ 0x725c000] cabac decode of qscale diff failed at 72 22 [h264 @ 0x725c000] error while decoding MB 72 22, bytestream 38564 [h264 @ 0x6b4ba80] Invalid NAL unit size (2007238032 > 9088). [h264 @ 0x6b4ba80] Error splitting the input into NAL units. [h264 @ 0x725c000] Invalid NAL unit size (2027649887 > 4780). [h264 @ 0x725c000] Error splitting the input into NAL units. Traceback (most recent call last): File "object_tracking.py", line 15, in boxes = model.get_boxes(frame) File "/content/object-tracking/mobile_net.py", line 114, in get_boxes converted_img = tf.image.convert_image_dtype(frame, tf.float32)[tf.newaxis, ...] File "/usr/local/lib/python3.8/dist-packages/tensorflow/python/util/traceback_utils.py", line 153, in error_handler raise e.with_traceback(filtered_tb) from None File "/usr/local/lib/python3.8/dist-packages/tensorflow/python/framework/constant_op.py", line 102, in convert_to_eager_tensor return ops.EagerTensor(value, ctx.device_name, dtype) ValueError: Attempt to convert a value (None) with an unsupported type (<class 'NoneType'>) to a Tensor.