Search code examples
pythonscikit-learn

No module named 'sklearn.utils.linear_assignment_'


I am trying to run a project from github , every object counter applications using sort algorithm. I can't run any of them because of a specific error, attaching errors screenshot. Can anyone help me about fixing this issue? enter image description here


Solution

  • The linear_assignment function is deprecated in 0.21 and will be removed from 0.23, but sklearn.utils.linear_assignment_ can be replaced by scipy.optimize.linear_sum_assignment.

    You can use:

    from scipy.optimize import linear_sum_assignment as linear_assignment
    

    then you can run the file and don't need to change the code.