yehengchen / Object-Detection-and-Tracking

Object Detection and Multi-Object Tracking
MIT License
1.82k stars 753 forks source link

【TypeError: tuple indices must be integers or slices, not tuple】in deep_sort_yolov3 #98

Closed rdzfv closed 3 years ago

rdzfv commented 3 years ago

it happened when i changed from sklearn.utils.linear_assignment_ import linear_assignment to from scipy.optimize import linear_sum_assignment as linear_assignment because sklearn's linear_assignment has been removed starting with version "0.23.0" and higher.

Then I got the error:TypeError: tuple indices must be integers or slices, not tuple on 【linear_assignment.py", line 63】 if col not in indices[:, 1]:

I tried to change indices[:, 1] to np.array(indices)[:, 1],it worked but I got indices:[[0],[0]](as a result indices[:, 1] went wrong: out of index) because of the previous indices is (array([0], dtype=int64), array([0], dtype=int64))

I could not figure out what happened, could someone give me a hand?

rdzfv commented 3 years ago

Solved:Both sklearn and scipy implement the Hungarian Algorithm, but they have different format of return. you can see more detail in https://blog.csdn.net/weixin_45676236/article/details/107842567