Skip to content
This repository has been archived by the owner on Jul 10, 2021. It is now read-only.

ValueError: a length-2 tuple must be passed in for 'shape' #216

Open
forloverj opened this issue Jul 29, 2016 · 2 comments
Open

ValueError: a length-2 tuple must be passed in for 'shape' #216

forloverj opened this issue Jul 29, 2016 · 2 comments

Comments

@forloverj
Copy link

ERROR: test_FitError (sknn.tests.test_types.TestConvolution)

Traceback (most recent call last):
File "/home/lj/scikit-neuralnetwork/sknn/tests/test_types.py", line 132, in test_FitError
assert_raises((TypeError, NotImplementedError), self.nn._fit, X, y)
File "/usr/lib/python2.7/unittest/case.py", line 473, in assertRaises
callableObj(_args, *_kwargs)
File "/home/lj/scikit-neuralnetwork/sknn/mlp.py", line 210, in _fit
X, y = self._reshape(X, y)
File "/home/lj/scikit-neuralnetwork/sknn/mlp.py", line 121, in _reshape
X = X.reshape((X.shape[0], int(size), int(size), 1))
File "/usr/local/lib/python2.7/dist-packages/scipy/sparse/lil.py", line 421, in reshape
raise ValueError("a length-2 tuple must be passed in for 'shape'")
ValueError: a length-2 tuple must be passed in for 'shape'

when I run the 'nosetests -v sknn.tests', I got the upper error .Just one error. But I don't know how to modify the code. What should I do to correct this error? Thank you very much.

@Rex-Diego
Copy link

It's a recent issue, after refering so many older successful installation log on the internet, I find use scipy 0.17.0 can solve this problem.

Just:
pip install scipy==0.17.0

hope this can help.

@GJCEXP
Copy link

GJCEXP commented Jun 15, 2017

But if the version of python is 3.6, how to solve it? Scipy 0.17.0 can't be installed.

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

No branches or pull requests

3 participants