zalandoresearch / fashion-mnist

A MNIST-like fashion product database. Benchmark :point_down:
http://fashion-mnist.s3-website.eu-central-1.amazonaws.com/
MIT License
11.99k stars 3.03k forks source link

error on "from sklearn.utils import shuffle" #142

Open geraldsnyman opened 5 years ago

geraldsnyman commented 5 years ago

I'm working through this tutorial on https://www.tensorflow.org/

To date have I not find a single CNN that actually works. All tutorials shows how awesome they are, but when I run the scripts, they have errors. If it works, then it fails horribly in when I want to run my own data. I've trained a keras example on "cats and dogs". The prediction images given test correctly for dog or cat, but photos of my own cat get predicted as dog. It's really depressing.

I've learned to pip install --update numpy and other packages. been at https://www.scipy.org/install.html and stackoverflow

Nothing works. Please help. I really wish to actually get a CNN to work. I wish to train a CNN to recognize my own 2 cats, while rejecting other cats. I want to make a pet door that opens only for my 2 cats. Perhaps keeping mice/bird catches outside too. But yeah, I just can't find a working CNN to begin with...

What am I doing wrong?

FILE: ./benchmark/convnet.py LINE 7: from sklearn.utils import shuffle

from sklearn.utils import shuffle Traceback (most recent call last):

File "", line 1, in from sklearn.utils import shuffle

File "C:\Users\Gerald\Anaconda3\lib\site-packages\sklearn__init__.py", line 64, in from .base import clone

File "C:\Users\Gerald\Anaconda3\lib\site-packages\sklearn\base.py", line 14, in from .utils.fixes import signature

File "C:\Users\Gerald\Anaconda3\lib\site-packages\sklearn\utils__init__.py", line 16, in from .fixes import _Sequence as Sequence

File "C:\Users\Gerald\Anaconda3\lib\site-packages\sklearn\utils\fixes.py", line 92, in from scipy.sparse.linalg import lsqr as sparse_lsqr # noqa

File "C:\Users\Gerald\Anaconda3\lib\site-packages\scipy\sparse\linalg__init__.py", line 114, in from .isolve import *

File "C:\Users\Gerald\Anaconda3\lib\site-packages\scipy\sparse\linalg\isolve__init__.py", line 6, in from .iterative import *

File "C:\Users\Gerald\Anaconda3\lib\site-packages\scipy\sparse\linalg\isolve\iterative.py", line 135, in def bicg(A, b, x0=None, tol=1e-5, maxiter=None, M=None, callback=None, atol=None):

File "C:\Users\Gerald\Anaconda3\lib\site-packages\scipy_lib_threadsafety.py", line 59, in decorator return lock.decorate(func)

File "C:\Users\Gerald\Anaconda3\lib\site-packages\scipy_lib_threadsafety.py", line 47, in decorate return scipy._lib.decorator.decorate(func, caller)

AttributeError: module 'scipy' has no attribute '_lib'

tahira2k16 commented 1 year ago

It looks like you're encountering an error related to the scipy library when running your convolutional neural network (CNN) script. try this pip install --upgrade scipy OR conda create -n myenv python=3.8 conda activate myenv pip install tensorflow scikit-learn OR pip uninstall scipy scikit-learn pip install scipy scikit-learn