Keras-Yolo-v2 icon indicating copy to clipboard operation
Keras-Yolo-v2 copied to clipboard

Train TinyYOLOv2 from scratch

Open jefersonf opened this issue 5 years ago • 2 comments

Hi, I am trying to train the TinyYOLOv2 model with VOC07 dataset. I've defined the function to fetch bounding boxes and labels for all the training images. But after fitting the model the output returns empty arrays when I make tiny.m.forward(image)[0] for a test image.

The training set is (318, 416, 416, 3) and the y_true is (318, 13, 13, 5, 25).

Am I doing something wrong? During fitting the loss information per epoch was always NaN.

jefersonf avatar Aug 13 '19 12:08 jefersonf

Hey!

I would recommend you first check your code to make sure the data you're feeding to the model/loss function is what you expect (I.e. make sure you don't have NaNs in your training data!).

It's also very possible there's a bug in the implementation of the loss, which could explain why you get NaNs for the loss.

Beyond this I can't really help... I'll have a quick look later if I have time. If you do discover a bug and fix it then feel free to submit a PR.

guigzzz avatar Aug 13 '19 13:08 guigzzz

Also as a starting point I would recommend you try to train the model on a single datapoint to make sure you can overfit it. It you can't even do that then the loss is broken. If you can overfit then you have a problem in your code/data.

On a side note, I should really add unit tests for all the models and the loss...

guigzzz avatar Aug 13 '19 13:08 guigzzz