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

版本修改问题 #190

Open
iphanazi opened this issue Jan 5, 2024 · 0 comments
Open

版本修改问题 #190

iphanazi opened this issue Jan 5, 2024 · 0 comments

Comments

@iphanazi
Copy link

iphanazi commented Jan 5, 2024

请问作者v0.0.2版本中的
` def training_step(self, batch):
(sweep_imgs, mats, _, _, gt_boxes, gt_labels, depth_labels) = batch
if torch.cuda.is_available():
for key, value in mats.items():
mats[key] = value.cuda()
sweep_imgs = sweep_imgs.cuda()
gt_boxes = [gt_box.cuda() for gt_box in gt_boxes]
gt_labels = [gt_label.cuda() for gt_label in gt_labels]
preds, depth_preds = self(sweep_imgs, mats)
if isinstance(self.model, torch.nn.parallel.DistributedDataParallel):
targets = self.model.module.get_targets(gt_boxes, gt_labels)
detection_loss = self.model.module.loss(targets, preds)
else:
targets = self.model.get_targets(gt_boxes, gt_labels)
detection_loss = self.model.loss(targets, preds)

    if len(depth_labels.shape) == 5:
        # only key-frame will calculate depth loss
        depth_labels = depth_labels[:, 0, ...]
    depth_loss = self.get_depth_loss(depth_labels.cuda(), depth_preds)
    self.log('detection_loss', detection_loss)
    self.log('depth_loss', depth_loss)
    return detection_loss + depth_loss`

为什么被修改了

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

1 participant