experiencor / keras-yolo2

Easy training on custom dataset. Various backends (MobileNet and SqueezeNet) supported. A YOLO demo to detect raccoon run entirely in brower is accessible at https://git.io/vF7vI (not on Windows).
MIT License
1.73k stars 784 forks source link

val_loss did not improve from inf #344

Open Yufeng4024 opened 6 years ago

Yufeng4024 commented 6 years ago

When training the Kangaroo data, received the following message:

Epoch 00003: val_loss did not improve from inf Epoch 00003: early stopping

Please share your thoughts on what I did wrong.

letilessa commented 6 years ago

Change the early stopping callback (https://keras.io/callbacks/#earlystopping) or don't use it.

Yufeng4024 commented 6 years ago

letilessa, what adverse effect will this have?

Yufeng4024 commented 6 years ago

After disabling the Callbacks for early_stop, I completed the training. However, the following error appears in model.load_weights("weights_coco.h5"): 'No such file or directory' Where is "weights_coco.h5" created? Is this the weights file after training? I don't see it in the code.

letilessa commented 6 years ago

In README.md there is a link to download the weights file.

Yufeng4024 commented 6 years ago

Letilessa, This happened right after training with Kangaroo data. Should it be the weights after the training?

I could not find the line for this file in the README.md. Could you please send me the link?

letilessa commented 6 years ago

Are you using the notebook? If so this is the file generated by your training. Find where the file was saved in your computer and put the path in model.load_weights("file_path").

Yufeng4024 commented 6 years ago

letilessa, thank you very much for your help. I think I found the reason why I don't have the weight file, because I disabled the callbacks in the model.fit_generator.

Now my problem is: if I enable the callbacks in the model.fit_generator, I will encounter the same error as I raised in the beginning of this issue:

Epoch 00003: val_loss did not improve from inf Epoch 00003: early stopping

Any suggestions how to eliminate the error?

letilessa commented 6 years ago

Just disable the early_stop and keep the checkpoint to save the model.