Ошибка fetch_lfw_people при изменении параметров (Python) - PullRequest
0 голосов
/ 19 мая 2018

Я следую этому примеру на sklean doc sklearn_doc , я могу выполнить пример, но если я изменю с:

fetch_lfw_people(min_faces_per_person=70, resize=0.4)  

на

fetch_lfw_people(min_faces_per_person=200, resize=1.0)   

Я ничего не изменил, кроме этих параметров, это int для другого int и float для другого float, я не вижу проблемы

Я получаю следующую ошибку:

Traceback (most recent call last):
  File "/home/user/anaconda3/envs/tema4/lib/python3.6/site-packages/sklearn/datasets/lfw.py", line 144, in _load_imgs
    from scipy.misc import imread
ImportError: cannot import name 'imread'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/user/.local/lib/python3.6/site-packages/scipy/misc/pilutil.py", line 19, in <module>
    from PIL import Image, ImageFilter
ModuleNotFoundError: No module named 'PIL'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/user/anaconda3/envs/tema4/lib/python3.6/site-packages/sklearn/datasets/lfw.py", line 146, in _load_imgs
    from scipy.misc.pilutil import imread
  File "/home/user/.local/lib/python3.6/site-packages/scipy/misc/pilutil.py", line 21, in <module>
    import Image
ModuleNotFoundError: No module named 'Image'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/user/PycharmProjects/practica/ejercicio1.py", line 25, in <module>
    lfw_people = fetch_lfw_people(min_faces_per_person=200, resize=1.0)
  File "/home/user/anaconda3/envs/tema4/lib/python3.6/site-packages/sklearn/datasets/lfw.py", line 335, in fetch_lfw_people
    min_faces_per_person=min_faces_per_person, color=color, slice_=slice_)
  File "/home/user/anaconda3/envs/tema4/lib/python3.6/site-packages/sklearn/externals/joblib/memory.py", line 562, in __call__
    return self._cached_call(args, kwargs)[0]
  File "/home/user/anaconda3/envs/tema4/lib/python3.6/site-packages/sklearn/externals/joblib/memory.py", line 510, in _cached_call
    out, metadata = self.call(*args, **kwargs)
  File "/home/user/anaconda3/envs/tema4/lib/python3.6/site-packages/sklearn/externals/joblib/memory.py", line 744, in call
    output = self.func(*args, **kwargs)
  File "/home/user/anaconda3/envs/tema4/lib/python3.6/site-packages/sklearn/datasets/lfw.py", line 236, in _fetch_lfw_people
    faces = _load_imgs(file_paths, slice_, color, resize)
  File "/home/user/anaconda3/envs/tema4/lib/python3.6/site-packages/sklearn/datasets/lfw.py", line 149, in _load_imgs
    raise ImportError("The Python Imaging Library (PIL)"
ImportError: The Python Imaging Library (PIL) is required to load data from jpeg files
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...