Skip to content
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

IndexError: index 0 is out of bounds for axis 0 with size 0 #43

Open
l-xk opened this issue Apr 23, 2021 · 1 comment
Open

IndexError: index 0 is out of bounds for axis 0 with size 0 #43

l-xk opened this issue Apr 23, 2021 · 1 comment

Comments

@l-xk
Copy link

l-xk commented Apr 23, 2021

I run iva.py on Jetson Nano using this command: python3 iva.py 0
But there is an error:

WARNING:tensorflow:Layer lstm will not use cuDNN kernel since it doesn't meet the cuDNN kernel criteria. It will use generic GPU kernel as fallback when running on GPU
Traceback (most recent call last):
File "iva.py", line 275, in
matched, unmatched_trackers, unmatched_detections = tracker_match(track_boxes, [b[0] for b in bboxes])
File "iva.py", line 139, in tracker_match
if(IOU_mat[m[0],m[1]] < iou_thrd):
IndexError: index 0 is out of bounds for axis 0 with size 0

Any ideas? Thanks!

@nexflatline
Copy link

nexflatline commented Jun 24, 2021

I found a fix. That error happens whenever there is nothing to be tracked on the video.
I added: if bboxes != []: before calling the function tracker_match on line 278, so the function won't be called if there is nothing to be tracked.

But now I get this other error instead (when there is something to be tracked):

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-4-791b3d45521f> in <module>
     13         track_boxes = [tracker.bbox for tracker in trackers]
     14         if bboxes != []:
---> 15             matched, unmatched_trackers, unmatched_detections = tracker_match(track_boxes, [b[0] for b in bboxes])
     16 
     17 

<ipython-input-1-3f9cc776614e> in tracker_match(trackers, detections, iou_thrd)
    130 
    131     for d, det in enumerate(detections):
--> 132         if(d not in matched_idx[:,1]):
    133             unmatched_detections.append(d)
    134 

TypeError: tuple indices must be integers or slices, not tuple

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants