-
Notifications
You must be signed in to change notification settings - Fork 522
Description
Line 92 in 6ca1b58
| self.reinitialize_detection_head(checkpoint_num_classes) |
If user creates a new model with:
model = RFDETRBase(num_classes=123)
The code linked above will overwrite the num classes specified by the users by the one in the checkpoint (90 by default). I don't think this is expected behavior. More worrisome, the config of the object stays with num_classes=123 which will cause issues in the train function.
If you call: model.train(dataset_dir=...) with the model above, it will check the number of classes in the dataset and compare it with self.model_config.num_classes which is still 123 in our example (even though the actual model has a 90 sized output layer). So if the number of classes in the dataset is indeed 123, the check will pass even though it should not.
A different issue it that if you try a dataset with a single class, the labels from the dataloader will have size zero.