-
Notifications
You must be signed in to change notification settings - Fork 7.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Training works but AssertionError for MODEL.ROI_HEADS.NUM_CLASSES only when COCOEvaluator is used #4922
Comments
You've chosen to report an unexpected problem or bug. Unless you already know the root cause of it, please include details about it by filling the issue template. |
Dear @ppwwyyxx Any suggestions, please? Thank you so much. |
You have to set to set NUM_CLASSES for roi_heads. About the warnings given, see #196 |
Thanks a lot. I did it. May I request you to look at the Questions section in my post above? |
Did you resolve the problem? I also faced the same problem even after setting NUM_CLASSES. |
Based on the suggestions mentioned in this discussion, I am trying to compute validation loss during the training of Mask R-CNN model. Please note that my dataset has only 1 class, say toys, which are small items (maximum 10 cm long).
Instructions To Reproduce the Issue:
ValLossHook
below:Observations:
While training together with computing validation loss, I noticed the following behaviors:
cfg
, the training works but theCOCOEvaluator
throwsAssertionError
as shown below:cfg.MODEL.ROI_HEADS.NUM_CLASSES = 1
. However, after adding this configuration, detectron2 is showing the following warning:COCOEvaluator
is showingnan
for APs. See below, please:Environment:
Questions:
NUM_CLASSES
forroi_heads
? Surprisingly, the training works even without setting it. Nevertheless, after setting it, detectron2 shows an incompatible message mentioned above. Does it mean that weights forroi_heads
are not loaded? Furthermore. does settingNUM_CLASSES
to 1 hurt model learning/performance?COCOEvaluator
show nan for APs in my dataset having only small objects?Thank you very much.
The text was updated successfully, but these errors were encountered: