-
Notifications
You must be signed in to change notification settings - Fork 165
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
too many indices for tensor of dimension 1 #1
Comments
同样的问题。。您现在是否解决了这个问题?@yuhongsheng110 @Sharpiless |
没能完全解决,只能跳过这个问题让程序正常运行。 USE TRY EXCEPT: use except to skip this |
我好像解决了,参考他之前的那个版本,在tracker.pyz中:
后面一串###是改动的地方。 |
这后面的###########是改动的地方,请问可以详细告知一下,怎么解决的嘛?感激不尽! |
@monoloxo Nice! 还有一个小问题我也顺带解决发出来,供参考。 在tracker.py中 update_tracker() 函数如下: ` def update_tracker(target_detector, image):
` 后面一串###是改动的地方。 |
这个错误主要是由于没有检测出任何目标造成的,bboxes这个list里面什么都没有就会报错 |
|
Hello, maybe I can help, 你好,我觉得问题的关键就是判断bboxes这个变量是否为空,这里修改的就是在这段代码前,添加一个对bboxes长度的if判断。
|
File "/home/car/code/laserscan_camera_fuse/Yolov5-Deepsort-ros/demo.py", line 63, in
main()
File "/home/car/code/laserscan_camera_fuse/Yolov5-Deepsort-ros/demo.py", line 31, in main
result = det.feedCap(im)
File "/home/car/code/laserscan_camera_fuse/Yolov5-Deepsort-ros/utils/BaseDetector.py", line 35, in feedCap
im, faces, face_bboxes,bboxes_draw = update_tracker(self, im)
File "/home/car/code/laserscan_camera_fuse/Yolov5-Deepsort-ros/tracker.py", line 60, in update_tracker
outputs = deepsort.update(xywhs, confss, clss, image)
File "/home/car/code/laserscan_camera_fuse/Yolov5-Deepsort-ros/deep_sort/deep_sort/deep_sort.py", line 32, in update
bbox_tlwh = self._xywh_to_tlwh(bbox_xywh)
File "/home/car/code/laserscan_camera_fuse/Yolov5-Deepsort-ros/deep_sort/deep_sort/deep_sort.py", line 55, in _xywh_to_tlwh
bbox_tlwh[:, 0] = bbox_xywh[:, 0] - bbox_xywh[:, 2]/2.
IndexError: too many indices for tensor of dimension 1
when i try to debug ,i found that the issues occured when the image cannot be detected anything
Easy skip :
USE TRY EXCEPT: use except to skip this
try: result = det.feedCap(im) except Exception as e: result = {} print(e)
if the bug can be solved perfectly ,that 's would be wonderful! thanks @Sharpiless
The text was updated successfully, but these errors were encountered: