Dear all:
Excuse me, it seems like there is a error in training process. Before I train the model, I check the code about data set in mmdet/datasets/coco.py and function (def load_annotations) show self.cat2label = {cat_id: i + 1 for i, cat_id in enumerate(self.cat_ids)}. So I suppose the label of background is 0. And I check the code of model in mmdet/models/anchor_heads/solov2_head.py. In function (def init), self.cate_out_channels = self.num_classes - 1, so the output channel of mscoco data set is 80 without background included. What make me confused is that in the function (def solov2_target_single),cate_label = torch.zeros([num_grid, num_grid], dtype=torch.int64, device=device), it seems the target variable cate_label is initialized as 0, but here 0 represent the label person in mscoco data set because the output channel do not contain background label. So I suppose may be what you want is likecate_label = torch.ones([num_grid, num_grid], dtype=torch.int64, device=device) * self.cate_out_channels` or the output channel should be 81, or I misunderstanding the meaning.
Looking forward to your reply and thanks for all your work.
Dear all: Excuse me, it seems like there is a error in training process. Before I train the model, I check the code about data set in mmdet/datasets/coco.py and function (def load_annotations) show
self.cat2label = {cat_id: i + 1 for i, cat_id in enumerate(self.cat_ids)}
. So I suppose the label of background is 0. And I check the code of model in mmdet/models/anchor_heads/solov2_head.py. In function (def init),self.cate_out_channels
= self.num_classes - 1, so the output channel of mscoco data set is 80 without background included. What make me confused is that in the function (def solov2_target_single),
cate_label = torch.zeros([num_grid, num_grid], dtype=torch.int64, device=device), it seems the target variable cate_label is initialized as 0, but here 0 represent the label person in mscoco data set because the output channel do not contain background label. So I suppose may be what you want is like
cate_label = torch.ones([num_grid, num_grid], dtype=torch.int64, device=device) * self.cate_out_channels` or the output channel should be 81, or I misunderstanding the meaning.Looking forward to your reply and thanks for all your work.