Open stu-zhangxl opened 1 year ago
Traceback (most recent call last): File "d:\work_paul\11_new_workspace\mobilenetssdv2_tf\v1\mobilenet-ssd-keras-master\predict.py", line 77, in r_image = ssd.detect_image(image, crop = crop, count=count) File "d:\work_paul\11_new_workspace\mobilenetssdv2_tf\v1\mobilenet-ssd-keras-master\ssd.py", line 124, in detect_image results = self.bbox_util.decode_box(preds, self.anchors, image_shape, File "d:\work_paul\11_new_workspace\mobilenetssdv2_tf\v1\mobilenet-ssd-keras-master\utils\utils_bbox.py", line 114, in decode_box idx = self.sess.run(self.nms, feed_dict={self.boxes: boxes_to_process, self.scores: confs_to_process}) File "D:\softwres\py\lib\site-packages\keras\engine\keras_tensor.py", line 268, in hash raise TypeError( TypeError: Tensors are unhashable (this tensor: KerasTensor(type_spec=TensorSpec(shape=(None, 4), dtype=tf.float32, name=None), description="created by layer 'input_1'")). Instead, use tensor.ref() as the key.
请问这个issue该如何修正呢?
估计是版本吧
Traceback (most recent call last): File "d:\work_paul\11_new_workspace\mobilenetssdv2_tf\v1\mobilenet-ssd-keras-master\predict.py", line 77, in
r_image = ssd.detect_image(image, crop = crop, count=count)
File "d:\work_paul\11_new_workspace\mobilenetssdv2_tf\v1\mobilenet-ssd-keras-master\ssd.py", line 124, in detect_image
results = self.bbox_util.decode_box(preds, self.anchors, image_shape,
File "d:\work_paul\11_new_workspace\mobilenetssdv2_tf\v1\mobilenet-ssd-keras-master\utils\utils_bbox.py", line 114, in decode_box
idx = self.sess.run(self.nms, feed_dict={self.boxes: boxes_to_process, self.scores: confs_to_process})
File "D:\softwres\py\lib\site-packages\keras\engine\keras_tensor.py", line 268, in hash
raise TypeError(
TypeError: Tensors are unhashable (this tensor: KerasTensor(type_spec=TensorSpec(shape=(None, 4), dtype=tf.float32, name=None), description="created by layer 'input_1'")). Instead, use tensor.ref() as the key.