Bartzi / see

Code for the AAAI 2018 publication "SEE: Towards Semi-Supervised End-to-End Scene Text Recognition"
GNU General Public License v3.0
573 stars 147 forks source link

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

Open zhangyilollipop opened 4 years ago

zhangyilollipop commented 4 years ago

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 commented 4 years ago

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

Bartzi commented 4 years ago

Are you using your own dataset?

zhangyilollipop commented 4 years ago

Are you using your own dataset?

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

Bartzi commented 4 years ago

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 commented 4 years ago

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.