Skip to content
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

Question about loss_cls_ic #4

Closed
Yifei-Y opened this issue Apr 17, 2022 · 3 comments
Closed

Question about loss_cls_ic #4

Yifei-Y opened this issue Apr 17, 2022 · 3 comments

Comments

@Yifei-Y
Copy link

Yifei-Y commented Apr 17, 2022

Nice job! I am trying to reproduce your work. But I find that loss_cls_ic is 0 for most of the time after the training started. Is it normal? (I set batch_size=4 because of the limited computational resources.)
Thanks.

@csuhan
Copy link
Owner

csuhan commented Apr 17, 2022

You can check our training log at here, loss_cls_ic should not be zero. Note that we use 8 GPUs and a batch size of 16 by default.

Besides, you can set break points in the following code:

def get_ic_loss(self, feat, gt_classes, ious):
# select foreground and iou > thr instance in a mini-batch
pos_inds = (ious > self.ic_loss_batch_iou_thr) & (
gt_classes != self.num_classes)
feat, gt_classes = feat[pos_inds], gt_classes[pos_inds]
queue = self.queue.reshape(-1, self.ic_loss_out_dim)
queue_label = self.queue_label.reshape(-1)
queue_inds = queue_label != -1 # filter empty queue
queue, queue_label = queue[queue_inds], queue_label[queue_inds]
loss_ic_loss = self.ic_loss_loss(feat, gt_classes, queue, queue_label)
# loss decay
storage = get_event_storage()
decay_weight = 1.0 - storage.iter / self.max_iters
return {"loss_cls_ic": self.ic_loss_weight * decay_weight * loss_ic_loss}

@Yifei-Y
Copy link
Author

Yifei-Y commented Apr 17, 2022

Thanks! I have found the error in my code.

@Yifei-Y Yifei-Y closed this as completed Apr 17, 2022
@Kyfafyd
Copy link

Kyfafyd commented Jul 6, 2022

Thanks! I have found the error in my code.

hi, how you solve the error?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants