broadinstitute / keras-rcnn

Keras package for region-based convolutional neural networks (RCNNs)
Other
552 stars 224 forks source link

NaN loss when object has category not in dictionary #186

Open jhung0 opened 6 years ago

jhung0 commented 6 years ago

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

0x00b1 commented 6 years ago

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?

jhung0 commented 6 years ago

Ideally a warning and make it just skip that object

0x00b1 commented 6 years ago

@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?

jhung0 commented 6 years ago
training_dictionary, test_dictionary = keras_rcnn.datasets.shape.load_data()

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