从iPython开始,我执行了
from sklearn.datasets import fetch_olivetti_faces
该命令似乎立即执行,In [43]
出现在命令的前面。
但是我在get_home_data()
给出的位置找不到任何内容,我也不能
data = fetch_olivetti_faces()
错误:
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-44-6a7f4fc09c38> in <module>()
1 # fetch the faces data
----> 2 data = fetch_olivetti_faces()
C:\Python33\lib\site-packages\sklearn\datasets\olivetti_faces.py in fetch_olivetti_faces(data_home, shuffle, random_state, download_if_missing)
87 % (DATA_URL, data_home)))
88 fhandle = urllib.request.urlopen(DATA_URL)
---> 89 buf = StringIO(fhandle.read())
90 mfile = loadmat(buf)
91 faces = mfile['faces'].T.copy()
TypeError: initial_value must be str or None, not bytes
downloading Olivetti faces from http://cs.nyu.edu/~roweis/data/olivettifaces.mat to C:\Users\me\scikit_learn_data
答案 0 :(得分:1)
这是scikit-learn中最近修复的错误:https://github.com/scikit-learn/scikit-learn/commit/a344f1054095c425236c1be50cf6eb23dc74eb40