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

I got a question when I run the train_svhn.py #88

Open
zhangyilollipop opened this issue Nov 4, 2019 · 5 comments
Open

I got a question when I run the train_svhn.py #88

zhangyilollipop opened this issue Nov 4, 2019 · 5 comments

Comments

@zhangyilollipop
Copy link

Exception in main training loop: Unsupported type <class 'NoneType'>
Traceback (most recent call last):
File "/root/.local/share/virtualenvs/pipenvtest-iRS5t8jD/lib/python3.6/site-packages/chainer/training/trainer.py", line 316, in run
update()
File "/root/.local/share/virtualenvs/pipenvtest-iRS5t8jD/lib/python3.6/site-packages/chainer/training/updaters/standard_updater.py", line 175, in update
self.update_core()
File "/root/.local/share/virtualenvs/pipenvtest-iRS5t8jD/lib/python3.6/site-packages/chainer/training/updaters/multiprocess_parallel_updater.py", line 238, in update_core
loss = _calc_loss(self._master, batch)
File "/root/.local/share/virtualenvs/pipenvtest-iRS5t8jD/lib/python3.6/site-packages/chainer/training/updaters/multiprocess_parallel_updater.py", line 274, in _calc_loss
return model(*in_arrays)
File "/home/zy/pipenvtest/see-master/chainer/utils/multi_accuracy_classifier.py", line 48, in call
reported_accuracies = self.accfun(self.y, t)
File "/home/zy/pipenvtest/see-master/chainer/metrics/svhn_softmax_metrics.py", line 48, in calc_accuracy
words = self.strip_prediction(classification)
File "/home/zy/pipenvtest/see-master/chainer/metrics/loss_metrics.py", line 60, in strip_prediction
if char == self.blank_symbol:
File "cupy/core/core.pyx", line 887, in cupy.core.core.ndarray.richcmp
File "cupy/core/_kernel.pyx", line 811, in cupy.core._kernel.ufunc.call
File "cupy/core/_kernel.pyx", line 89, in cupy.core._kernel._preprocess_args
Will finalize trainer extensions and updater before reraising the exception.

@zhangyilollipop
Copy link
Author

python chainer/train_svhn.py datasets/svhn/svhn_new/curriculum_specification.json datasets/svhn/svhn_new/svhn_generated_models -g 0 --char-map datasets/svhn/svhn_char_map.json -lr 0.000001 -b 10 -li 10 --epochs 10

@zhangyilollipop zhangyilollipop changed the title I got a question when I use the following command. I got a question when I run the train_svhn.py Nov 4, 2019
@Bartzi
Copy link
Owner

Bartzi commented Nov 4, 2019

Are you using your own dataset?

@zhangyilollipop
Copy link
Author

Are you using your own dataset?

no, I use the grid dataset which generated from original svhn data.

@Bartzi
Copy link
Owner

Bartzi commented Nov 6, 2019

Hmm, difficult to say.
As you can see from the error message, it seems that some variable is None although it shouldn't be (Exception in main training loop: Unsupported type <class 'NoneType'>)
If we look at the stacktrace, we can see that the value is used here: File "/home/zy/pipenvtest/see-master/chainer/metrics/loss_metrics.py", line 60, in strip_prediction if char == self.blank_symbol:
So my advice is, to use a debugger and determine which of the two values is None. Maybe that helps to find the cause of the problem.

@zhangyilollipop
Copy link
Author

Hmm, difficult to say.
As you can see from the error message, it seems that some variable is None although it shouldn't be (Exception in main training loop: Unsupported type <class 'NoneType'>)
If we look at the stacktrace, we can see that the value is used here: File "/home/zy/pipenvtest/see-master/chainer/metrics/loss_metrics.py", line 60, in strip_prediction if char == self.blank_symbol:
So my advice is, to use a debugger and determine which of the two values is None. Maybe that helps to find the cause of the problem.

ok, I will try this. Thanks a lot.

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