nosetests -v sklearn失败

时间:2017-03-15 11:18:50

标签: scikit-learn

我正在尝试将我的keras和tensorflow-gpu代码用于我的带有GPU的新Windows 10 64位PC。我已按照Advanced Scikit Installation Intructions的说明进行操作,但当我尝试使用nosetest测试Scikit-learn时,它会因以下错误而失败:

请帮我解决这个问题。

D:\>nosetests -v sklearn
Failure: TypeError (unorderable types: str() < int()) ... ERROR

======================================================================
ERROR: Failure: TypeError (unorderable types: str() < int())
----------------------------------------------------------------------
Traceback (most recent call last):
  File "c:\users\ranaalisaeed\appdata\local\programs\python\python35\lib\site-packages\nose\failure.py", line 39, in runTest
    raise self.exc_val.with_traceback(self.tb)
  File "c:\users\ranaalisaeed\appdata\local\programs\python\python35\lib\site-packages\nose\loader.py", line 407, in loadTestsFromName
    module = resolve_name(addr.module)
  File "c:\users\ranaalisaeed\appdata\local\programs\python\python35\lib\site-packages\nose\util.py", line 312, in resolve_name
    module = __import__('.'.join(parts_copy))
  File "c:\users\ranaalisaeed\appdata\local\programs\python\python35\lib\site-packages\sklearn\__init__.py", line 57, in <module>
    from .base import clone
  File "c:\users\ranaalisaeed\appdata\local\programs\python\python35\lib\site-packages\sklearn\base.py", line 12, in <module>
    from .utils.fixes import signature
  File "c:\users\ranaalisaeed\appdata\local\programs\python\python35\lib\site-packages\sklearn\utils\__init__.py", line 11, in <module>
    from .validation import (as_float_array,
  File "c:\users\ranaalisaeed\appdata\local\programs\python\python35\lib\site-packages\sklearn\utils\validation.py", line 18, in <module>
    from ..utils.fixes import signature
  File "c:\users\ranaalisaeed\appdata\local\programs\python\python35\lib\site-packages\sklearn\utils\fixes.py", line 406, in <module>
    if np_version < (1, 12, 0):
TypeError: unorderable types: str() < int()

----------------------------------------------------------------------
Ran 1 test in 0.001s

FAILED (errors=1)
D:\>python -c "import nose; nose.main()" -v sklearn
Failure: TypeError (unorderable types: str() < int()) ... ERROR

======================================================================
ERROR: Failure: TypeError (unorderable types: str() < int())
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Users\ranaalisaeed\AppData\Local\Programs\Python\Python35\lib\site-packages\nose\failure.py", line 39, in runTest
    raise self.exc_val.with_traceback(self.tb)
  File "C:\Users\ranaalisaeed\AppData\Local\Programs\Python\Python35\lib\site-packages\nose\loader.py", line 407, in loadTestsFromName
    module = resolve_name(addr.module)
  File "C:\Users\ranaalisaeed\AppData\Local\Programs\Python\Python35\lib\site-packages\nose\util.py", line 312, in resolve_name
    module = __import__('.'.join(parts_copy))
  File "C:\Users\ranaalisaeed\AppData\Local\Programs\Python\Python35\lib\site-packages\sklearn\__init__.py", line 57, in <module>
    from .base import clone
  File "C:\Users\ranaalisaeed\AppData\Local\Programs\Python\Python35\lib\site-packages\sklearn\base.py", line 12, in <module>
    from .utils.fixes import signature
  File "C:\Users\ranaalisaeed\AppData\Local\Programs\Python\Python35\lib\site-packages\sklearn\utils\__init__.py", line 11, in <module>
    from .validation import (as_float_array,
  File "C:\Users\ranaalisaeed\AppData\Local\Programs\Python\Python35\lib\site-packages\sklearn\utils\validation.py", line 18, in <module>
    from ..utils.fixes import signature
  File "C:\Users\ranaalisaeed\AppData\Local\Programs\Python\Python35\lib\site-packages\sklearn\utils\fixes.py", line 406, in <module>
    if np_version < (1, 12, 0):
TypeError: unorderable types: str() < int()

----------------------------------------------------------------------
Ran 1 test in 0.001s

FAILED (errors=1)

我的环境如下:

appdirs==1.4.3
cycler==0.10.0
h5py==2.7.0rc3
Keras==2.0.0
matplotlib==2.0.0
nose==1.3.7
numpy==1.12.1rc1+mkl
olefile==0.44
opencv-python==3.2.0
packaging==16.8
pandas==0.19.2
Pillow==4.0.0
protobuf==3.2.0
psutil==5.2.0
pyparsing==2.2.0
PyPrind==2.10.0
python-dateutil==2.6.0
pytz==2016.10
PyYAML==3.12
scikit-learn==0.18.1
scipy==0.19.0
six==1.10.0
sklearn==0.0
sklearn-contrib-lightning==0.4.0
tensorflow-gpu==1.0.1

0 个答案:

没有答案