Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
geraldsnyman opened this issue May 7, 2019 · 1 comment
Open

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

geraldsnyman opened this issue May 7, 2019 · 1 comment

Comments

@geraldsnyman
Copy link

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
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants