ethnhe / PVN3D

Code for "PVN3D: A Deep Point-wise 3D Keypoints Hough Voting Network for 6DoF Pose Estimation", CVPR 2020
MIT License
488 stars 105 forks source link

RuntimeError: shape '[2, 12288, 8, 3]' is invalid for input of size 7372800 #67

Closed luigifaticoso closed 3 years ago

luigifaticoso commented 3 years ago

When running the train of my custom data, this happens. I'm investing on what is it causing it. Still can't find the cause. Any help would be apreciated. Thank you

Traceback (most recent call last):                                              
  File "/usr/lib/python3.7/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.7/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/home/pytorch/PVN3D/pvn3d/train/train_blm_pvn3d.py", line 547, in <module>
    best_loss=best_loss
  File "/home/pytorch/PVN3D/pvn3d/train/train_blm_pvn3d.py", line 376, in train
    _, loss, res = self.model_fn(self.model, batch)
  File "/home/pytorch/PVN3D/pvn3d/train/train_blm_pvn3d.py", line 196, in model_fn
    pred_kp_of, kp_targ_ofst, labels,
  File "/usr/local/lib/python3.7/dist-packages/torch/nn/modules/module.py", line 550, in __call__
    result = self.forward(*input, **kwargs)
  File "/usr/local/lib/python3.7/dist-packages/torch/nn/parallel/data_parallel.py", line 153, in forward
    return self.module(*inputs[0], **kwargs[0])
  File "/usr/local/lib/python3.7/dist-packages/torch/nn/modules/module.py", line 550, in __call__
    result = self.forward(*input, **kwargs)
  File "/home/pytorch/PVN3D/pvn3d/lib/loss.py", line 86, in forward
    sigma=1.0, normalize=True, reduce=False
  File "/home/pytorch/PVN3D/pvn3d/lib/loss.py", line 58, in of_l1_loss
    kp_targ_ofst = kp_targ_ofst.view(bs, n_pts, n_kpts, 3)
RuntimeError: shape '[2, 12288, 8, 3]' is invalid for input of size 7372800
luigifaticoso commented 3 years ago

I put different keypoints for better visualization of my data. By setting them back to self.n_keypoints = 8 in common.py I was able to solve the problem