Skip to content

[Filing bugs] Error:scikit-learn/sklearn/utils/fixes.py #7898

@willduan

Description

@willduan

There is a new bug in master brunch, scikit-learn/sklearn/utils/fixes.py
in line 406: if np_version < (1, 12, 0): , an error occured, TypeError: unorderable types: str() < int().
It's because in the function :

def _parse_version(version_string):
    version = []
    for x in version_string.split('.'):
        try:
            version.append(int(x))
        except ValueError:
            # x may be of the form dev-1ea1592
            version.append(x)
    return tuple(version)

However, my numpy version is:1.12.0b1, this funciotn return a tuple(1,12,'0b1') , but in line 406, It is compared with integer type, so the error occured.
I just in a simple way to solve it. I change the code to if np_version < (1, 12, '0'): in line 406, just change the third tuple index to string type.
Of course, this is not a common method.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions