-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
TypeError: tuple indices must be integers or slices, not tuple #136
Comments
I am facing a similar issue. I speculate that the code is broken because of sklearn.utils.linear_assignment_ which has to be changed to scipy.optimize.linear_sum_assignment Code
Debug output with error:
@adityamukherjee42 Were you able to solve the issue? |
No man still trying to |
@adityamukherjee42 Found a solution def linear_assignment(cost_matrix):
try:
import lap
_, x, y = lap.lapjv(cost_matrix, extend_cost=True)
return np.array([[y[i], i] for i in x if i >= 0])
except ImportError:
from scipy.optimize import linear_sum_assignment
x, y = linear_sum_assignment(cost_matrix)
return np.array(list(zip(x, y))) I hope this helps |
I'm facing the same issue, can you please explain more where to put those functions? |
sklearn.utils.linear_assignment_ was replaced with scipy.optimize.linear_sum_assignment since the latter was pruned in the current version. I found the above function in a previous commit. Follows these steps to fix the bug.
|
It's working now, many thanks |
Facing a ValueError now lap/_lapjv.pyx in lap._lapjv.lapjv() /usr/local/lib/python3.7/dist-packages/numpy/core/_methods.py in _amax(a, axis, out, keepdims, initial, where) ValueError: zero-size array to reduction operation maximum which has no identity |
i have been facing this issue not able to know which line please help
TypeError Traceback (most recent call last)
in
26 if detections is not None:
27 detections=np.array(detections)
---> 28 tracked_objects = mot_tracker.update(detections)
29 detections=torch.from_numpy(detections)
30 unique_labels = detections[:, -1].cpu().unique()
E:\Football player tracking\sort.py in update(self, dets)
207
208 #update matched trackers with assigned detections
--> 209 for t,trk in enumerate(self.trackers):
210 if(t not in unmatched_trks):
211 d = matched[np.where(matched[:,1]==t)[0],0]
E:\Football player tracking\sort.py in associate_detections_to_trackers(detections, trackers, iou_threshold)
150 for d,det in enumerate(detections):
151 if(d not in matched_indices[:,0]):
--> 152 unmatched_detections.append(d)
153 unmatched_trackers = []
154 for t,trk in enumerate(trackers):
TypeError: tuple indices must be integers or slices, not tuple
The text was updated successfully, but these errors were encountered: