keras-rcnn icon indicating copy to clipboard operation
keras-rcnn copied to clipboard

NaN loss when object has category not in dictionary

Open jhung0 opened this issue 6 years ago • 4 comments

If the dictionary of categories does not contain a category that an object has, the loss becomes NaN

jhung0 avatar Mar 01 '18 23:03 jhung0

An exception should be thrown (or warning should be returned) if the generator encounters a category that isn’t a member of the categories dictionary. What do you think?

0x00b1 avatar Mar 03 '18 17:03 0x00b1

Ideally a warning and make it just skip that object

jhung0 avatar Mar 04 '18 16:03 jhung0

@jhung0 I looked into this yesterday and couldn't reproduce. When I added a non-existent category the ObjectDetectionGenerator threw a missing key exception. Would you mind posting an example?

0x00b1 avatar Mar 04 '18 20:03 0x00b1

training_dictionary, test_dictionary = keras_rcnn.datasets.shape.load_data()

categories = {"circle": 1, "rectangle": 2}

jhung0 avatar Mar 05 '18 01:03 jhung0