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

When I swapped the 3D network for my own, some problems occurred #70

Open
Jaywxy opened this issue Jul 31, 2023 · 0 comments
Open

When I swapped the 3D network for my own, some problems occurred #70

Jaywxy opened this issue Jul 31, 2023 · 0 comments

Comments

@Jaywxy
Copy link

Jaywxy commented Jul 31, 2023

When I swapped the 3D network for my own, some problems occurred:

  File "/mnt/Mhd_4T/2.code/2DPASS/network/2dpass-repvgg3d.py", line 183, in forward
    data_dict = self.fusion(data_dict)
  File "/home/wxy/anaconda3/envs/spvnas/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1110, in _call_impl
    return forward_call(*input, **kwargs)
  File "/mnt/Mhd_4T/2.code/2DPASS/network/2dpass-repvgg3d.py", line 142, in forward
    singlescale_loss, fuse_feat = self.fusion_to_single_KD(data_dict, idx)
  File "/mnt/Mhd_4T/2.code/2DPASS/network/2dpass-repvgg3d.py", line 123, in fusion_to_single_KD
    seg_loss_3d = self.seg_loss(pts_pred_full, pts_label_full)
  File "/mnt/Mhd_4T/2.code/2DPASS/network/2dpass-repvgg3d.py", line 92, in seg_loss
    ce_loss = self.ce_loss(logits, labels)
  File "/home/wxy/anaconda3/envs/spvnas/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1110, in _call_impl
    return forward_call(*input, **kwargs)
  File "/home/wxy/anaconda3/envs/spvnas/lib/python3.7/site-packages/torch/nn/modules/loss.py", line 1165, in forward
    label_smoothing=self.label_smoothing)
  File "/home/wxy/anaconda3/envs/spvnas/lib/python3.7/site-packages/torch/nn/functional.py", line 2996, in cross_entropy
    return torch._C._nn.cross_entropy_loss(input, target, weight, _Reduction.get_enum(reduction), ignore_index, label_smoothing)
ValueError: Expected input batch_size (26166) to match target batch_size (26167).

This seems to be the reason for the inconsistency in size when seg_loss_3d = self.seg_loss(pts_pred_full, pts_label_full), but I don't understand why this happens, the grid division part and scales are both using your code, only modifying the 3D network part, hoping to get your reply,thanks!

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