1

I have added Class_Weights to be used while training Mask RCNN on custome dataset. It is showing error :

ValueError: Unknown entries in class_weight dictionary: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]. Only expected following keys: []

I have changed the dictionary to list and array but it does not work.

In my training script, created a dictionary containing the id and the number of events of each class. example :

CLASS_WEIGHTS = { 1:600, 2:10, 3:5,.. }

created a function that computes the weights which returns a dictionary.

After that when calling the train function in model.py, added a new parameter class_weight in the main train function localized in model.py code. Then passed the parameter class_weight = CLASS_WEIGHT.

Andromeda
  • 1,205
  • 1
  • 14
  • 21
Tima
  • 11
  • 1

0 Answers0