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

TrainSplit(eval_size=0.0) and BatchIterator(shuffle=True) crashes #296

Open
jrodrigog opened this issue Sep 18, 2016 · 1 comment
Open

Comments

@jrodrigog
Copy link

Hello. I have a little glitch here, when setting eval_size to 0 on the TrainSplit object nolearn only works if the validation BatchIterator has shuffle equal to False (the default).

Traceback (most recent call last):
  File "./test_dnn2.py", line 569, in <module>
    main()
  File "./test_dnn2.py", line 562, in main
    nn.fit(x, y)
  File "./test_dnn2.py", line 262, in fit
    self.net.fit(x, y)
  File "/usr/lib64/python3.4/site-packages/nolearn/lasagne/base.py", line 674, in fit
    self.train_loop(X, y, epochs=epochs)
  File "/usr/lib64/python3.4/site-packages/nolearn/lasagne/base.py", line 744, in train_loop
    for Xb, yb in self.batch_iterator_test(X_valid, y_valid):
  File "/usr/lib64/python3.4/site-packages/nolearn/lasagne/base.py", line 78, in __call__
    self._shuffle_arrays([X, y] if y is not None else [X], self.random)
  File "/usr/lib64/python3.4/site-packages/nolearn/lasagne/base.py", line 103, in _shuffle_arrays
    random.shuffle(array)
  File "mtrand.pyx", line 4656, in mtrand.RandomState.shuffle (numpy/random/mtrand/mtrand.c:30146)
IndexError: index 0 is out of bounds for axis 0 with size 0

Forgetting to change shuffle to False on the BatchIterator crashes.
Tested with nolearn-0.6.1.dev0.

@nickmitchko
Copy link
Contributor

nickmitchko commented Oct 24, 2016

Try upgrading nolearn to version 0.7

Command:

sudo pip3 install --upgrade --no-deps --force-reinstall git+https://github.com/dnouri/nolearn.git@master#egg=nolearn==0.7.git

If that fails try this workaround...

Try:

eval_size = 0.01

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