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

variable "classes_rgbd" got all zero for YCB #23

Closed kaixin-bai closed 3 years ago

kaixin-bai commented 4 years ago

while testing PVN3D on YCB Video Dataset, the variable "classes_rgbd" got all zeros with shape [1, 12288], and then got error

"File "/data/hdd1/PVN3D/pvn3d/lib/utils/pvn3d_eval_utils.py", line 56, in cal_frame_poses nctrs, = ctrs.size() ValueError: not enough values to unpack (expected 2, got 1) "

For Linemod dataset there's no such problem, and the variable "classes_rgbd" is not all zeros.

ethnhe commented 4 years ago

Strange then. Are you testing our pre-trained model?

kaixin-bai commented 4 years ago

yes, i use this checkpoint "checkpoint = "./train_log/ycb/checkpoints/ycb_pvn3d_best.pth.tar"

/data/hdd1/kb/anaconda2/envs/pvn3d/bin/python /data/hdd1/kb/pvn3d_test/PVN3D/pvn3d/demo_ycb_test.py
/data/hdd1/kb/pvn3d_test/PVN3D/pvn3d/common.py:134: YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details.
  self.lm_r_lst = yaml.load(lm_r_file)
test_dataset_size:  2949
loading pretrained mdl.
==> Loading from checkpoint './train_log/ycb/checkpoints/ycb_pvn3d_best.pth.tar'
==> Done
val: 0it [00:00, ?it/s]/data/hdd1/kb/anaconda2/envs/pvn3d/lib/python3.6/site-packages/torch/nn/functional.py:2351: UserWarning: nn.functional.upsample is deprecated. Use nn.functional.interpolate instead.
  warnings.warn("nn.functional.upsample is deprecated. Use nn.functional.interpolate instead.")
/data/hdd1/kb/anaconda2/envs/pvn3d/lib/python3.6/site-packages/torch/nn/functional.py:2423: UserWarning: Default upsampling behavior when mode=bilinear is changed to align_corners=False since 0.4.0. Please specify align_corners=True if the old behavior is desired. See the documentation of nn.Upsample for details.
  "See the documentation of nn.Upsample for details.".format(mode))
/data/hdd1/kb/anaconda2/envs/pvn3d/lib/python3.6/site-packages/torch/nn/modules/upsampling.py:129: UserWarning: nn.Upsample is deprecated. Use nn.functional.interpolate instead.
  warnings.warn("nn.{} is deprecated. Use nn.functional.interpolate instead.".format(self.name))
/data/hdd1/kb/anaconda2/envs/pvn3d/lib/python3.6/site-packages/torch/nn/modules/container.py:92: UserWarning: Implicit dimension choice for log_softmax has been deprecated. Change the call to include dim=X as an argument.
  input = module(input)
Traceback (most recent call last):
  File "/data/hdd1/kb/pvn3d_test/PVN3D/pvn3d/demo_ycb_test.py", line 228, in <module>
    main()
  File "/data/hdd1/kb/pvn3d_test/PVN3D/pvn3d/demo_ycb_test.py", line 224, in main
    cal_view_pred_pose(model, data, epoch=i, obj_id=obj_id)
  File "/data/hdd1/kb/pvn3d_test/PVN3D/pvn3d/demo_ycb_test.py", line 131, in cal_view_pred_pose
    config.n_objects, True
  File "/data/hdd1/kb/pvn3d_test/PVN3D/pvn3d/lib/utils/pvn3d_eval_utils.py", line 56, in cal_frame_poses
    n_ctrs, _ = ctrs.size()
ValueError: not enough values to unpack (expected 2, got 1)
kaixin-bai commented 4 years ago
        pred_kp_of, pred_rgbd_seg, pred_ctr_of = model(
            cld_rgb_nrm, rgb, choose
        )
        _, classes_rgbd = torch.max(pred_rgbd_seg, -1)

it seems that pred_rgbd_seg is already sorted, so the max index (classes_rgbd) always return 0.

ethnhe commented 4 years ago

First visualize and check that the input data is correct by running python3 -m datasets.ycb.ycb_dataset

QRayMoor commented 2 years ago

while testing PVN3D on YCB Video Dataset, the variable "classes_rgbd" got all zeros with shape [1, 12288], and then got error

"File "/data/hdd1/PVN3D/pvn3d/lib/utils/pvn3d_eval_utils.py", line 56, in cal_frame_poses nctrs, = ctrs.size() ValueError: not enough values to unpack (expected 2, got 1) "

For Linemod dataset there's no such problem, and the variable "classes_rgbd" is not all zeros.

Hi, I got the same problem, how did you fix it? Help and Thanks!