HPI-DeepLearning / crnn-lid

Code for the paper Language Identification Using Deep Convolutional Recurrent Neural Networks
GNU General Public License v3.0
105 stars 48 forks source link

Train error with finetune_crnn model. #23

Closed Varuzhan97 closed 4 years ago

Varuzhan97 commented 4 years ago

I am getting this error during train(after downloading and spectograming downloads ).

Epoch 1/50
Process Process-1:
Traceback (most recent call last):
  File "/usr/lib/python2.7/multiprocessing/process.py", line 267, in _bootstrap
    self.run()
  File "/usr/lib/python2.7/multiprocessing/process.py", line 114, in run
    self._target(*self._args, **self._kwargs)
  File "/home/varuzhan/.local/lib/python2.7/site-packages/keras/engine/training.py", line 404, in data_generator_task
    generator_output = next(generator)
  File "/home/varuzhan/Desktop/crnn-lid-master/keras/data_loaders/csv_loader.py", line 36, in get_data
    label_batch[i, :] = to_categorical([label], nb_classes=self.config["num_classes"]) # one-hot encoding
  File "/home/varuzhan/.local/lib/python2.7/site-packages/keras/utils/np_utils.py", line 23, in to_categorical
    Y[i, y[i]] = 1.
IndexError: index 4 is out of bounds for axis 1 with size 4
Traceback (most recent call last):
  File "/home/varuzhan/Desktop/crnn-lid-master/keras/train.py", line 88, in <module>
    model_file_name = train(cli_args, log_dir)
  File "/home/varuzhan/Desktop/crnn-lid-master/keras/train.py", line 62, in train
    pickle_safe=True
  File "/home/varuzhan/.local/lib/python2.7/site-packages/keras/models.py", line 907, in fit_generator
    pickle_safe=pickle_safe)
  File "/home/varuzhan/.local/lib/python2.7/site-packages/keras/engine/training.py", line 1425, in fit_generator
    'or (x, y). Found: ' + str(generator_output))
Exception: output of generator should be a tuple (x, y, sample_weight) or (x, y). Found: None
Bartzi commented 4 years ago

The problem is somewhere here:

File "/home/varuzhan/Desktop/crnn-lid-master/keras/data_loaders/csv_loader.py", line 36, in get_data
    label_batch[i, :] = to_categorical([label], nb_classes=self.config["num_classes"]) # one-hot encoding
  File "/home/varuzhan/.local/lib/python2.7/site-packages/keras/utils/np_utils.py", line 23, in to_categorical
    Y[i, y[i]] = 1.

But, that is all I can tell you from this traceback...

Varuzhan97 commented 4 years ago

Thanks. Problem solved by comenting 4 languages of num_class. And uncommenting 6 languages. But now I am getting this one: Epoch 1/50 Killed

Bartzi commented 4 years ago

very interesting. Seems that your OS kills the process. Maybe you are using to much RAM?

Varuzhan97 commented 4 years ago

No.It is not because of RAM. Ihave tried multyprocessint true/false too.