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

Fails to load weight file #26

Closed Arafat4341 closed 4 years ago

Arafat4341 commented 4 years ago

Hello! I am trying to run train.py module. Getting the following error:

IOError: Unable to open file (unable to open file: name = 'logs/2017-04-08-13-03-44/weights.08.model', errno = 2, error message = 'No such file or directory', flags = 0, o_flags = 0)

Error is coming form the topcoder_crnn_finetune.py module line: 38

model.load_weights("logs/2017-04-08-13-03-44/weights.08.model", by_name=True)

Why there is a static 2017-04-08-13-03-44 dir here? As long as I can see inside the logs folder directory gets generated with current date-time. And where can I get weights.08.model ? Please anyone kindly tell me whats going wrong here! Thanks in advance!

Bartzi commented 4 years ago

Good question why this is still in there. Just delete that line of code and you should be good to go!

Arafat4341 commented 4 years ago

@Bartzi Thanks for your response! Yeah I actually commented out that line and ran again. Well I am facing number of problems. I installed all the older version dependencies to run this system. But still facing a lot of problems.

Firstly: "precision", "fmeasure", recall they are not recognized as I got invalid metrics error. I removed them and only kept accuracy.

Now I am facing: ValueError:validation_steps=Noneis only valid for a generator based on thekeras.utils.Sequenceclass. Please specifyvalidation_stepsor use thekeras.utils.Sequenceclass.

problem starts from train.py line 62: pickle_safe=True

Full message:

File "train.py", line 63, in train
    pickle_safe=True
  File "/usr/local/lib/python2.7/dist-packages/keras/legacy/interfaces.py", line 91, in wrapper
    return func(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/keras/engine/training.py", line 1732, in fit_generator
    initial_epoch=initial_epoch)
  File "/usr/local/lib/python2.7/dist-packages/keras/engine/training_generator.py", line 76, in fit_generator
    raise ValueError('`validation_steps=None` is only valid for a'
ValueError: `validation_steps=None` is only valid for a generator based on the `keras.utils.Sequence` class. Please specify `validation_steps` or use the `keras.utils.Sequence` class.
Arafat4341 commented 4 years ago

I solved the issue. Thanks!

Aksh97 commented 2 years ago

@Arafat4341, Can you upload the model which works fine on your github?