see icon indicating copy to clipboard operation
see copied to clipboard

I got a question when I run the train_svhn.py

Open zhangyilollipop opened this issue 6 years ago • 5 comments

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 avatar Nov 04 '19 13:11 zhangyilollipop

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 avatar Nov 04 '19 13:11 zhangyilollipop

Are you using your own dataset?

Bartzi avatar Nov 04 '19 15:11 Bartzi

Are you using your own dataset?

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

zhangyilollipop avatar Nov 05 '19 01:11 zhangyilollipop

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.

Bartzi avatar Nov 06 '19 10:11 Bartzi

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.

zhangyilollipop avatar Nov 06 '19 12:11 zhangyilollipop