parasdahal / deepnet

Educational deep learning library in plain Numpy.
https://deepnotes.io/implementing-cnn
MIT License
320 stars 83 forks source link

'bool' object is not callable in solver.py #3

Closed TedaLIEz closed 6 years ago

TedaLIEz commented 6 years ago

I put the dataset manually in ./data/mnist.pkl.gz and run the python run_cnn.py mnist, but it gives an error:

Traceback (most recent call last): File "run_cnn.py", line 46, in learning_rate=0.01, X_test=X_test, y_test=y_test) File "/Users/JianGuo/PycharmProjects/deepnet/deepnet/solver.py", line 83, in sgd_momentum minibatches = get_minibatches(X_train, y_train, minibatch_size) File "/Users/JianGuo/PycharmProjects/deepnet/deepnet/solver.py", line 12, in get_minibatches X, y = shuffle(X, y) TypeError: 'bool' object is not callable

I doubt that this would be a compatible issue with the sklearn, but even I had installed the old version of scikit-learn(0.15), it turns out the same result.

Python version:

Python 3.6.3 (default, Oct 4 2017, 06:09:15) [GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.37)] on darwin Type "help", "copyright", "credits" or "license" for more information.

pip version:

pip 9.0.1 from /Users/JianGuo/PycharmProjects/deepnet/.env/lib/python3.6/site-packages (python 3.6)

requirements.txt:

numpy==1.11.3 scipy==0.16.1 matplotlib==1.5.0 ipykernel==4.2.2 ipython==4.0.1 ipython-genutils==0.1.0 ipywidgets==4.1.1 scikit-learn==0.15

Did I miss something here?

FranciscoTeixeira commented 6 years ago

I don't know if you were able to solve it already or not, but if you weren't, just change the name of the boolean variable 'shuffle' to something else, in lines 8 and 11 of solver.py.

TedaLIEz commented 6 years ago

@FranciscoTeixeira You are right. I didn't notice the shuffle param in the function. :)