GHM_Detection
GHM_Detection copied to clipboard
how to train only one classes
hi, I want to train only one class, I edit num_classes=2, bug I get this error RuntimeError: Expected object of type torch.cuda.FloatTensor but found type torch.cuda.LongTensor for argument #3 'other'
@fengxiuyaun could you provide more details? Such as the location where the error appear, and whether you write a new data_loader (since the default coco data set code do not support num_classes=2) .
hi, because this,
if cls_out_channels > 1:
labels, label_weights = expand_binary_labels(labels, label_weights,
cls_out_channels)
labels is not translation to float....
https://github.com/libuyu/GHM_Detection/blob/0b3917d95870382b1e01c9917e042a93436c5e32/mmdetection/mmdet/core/anchor/anchor_target.py#L146
Well done! So if you use binary classification (one class det), just modify this line.
It seems that mmdetection hasn't consider one class output channel now. I will talk with the contributors about this issue.
Thank you very much.