EPro-PnP
EPro-PnP copied to clipboard
The Cv2.solvepnp function prompts that the dimensions do not match
IndexError: boolean index did not match indexed array along dimension 1; dimension is 64 but corresponding boolean dimension is 2.
I found that dim=1 in pred_conf_np = w2d.mean(dim=1).cpu().numpy() needs to be modified to -1.
But after that there is a new error as follow.
Traceback (most recent call last):
File "main.py", line 108, in
The dimension-related issue is a duplicate of #17, which has been fixed in the latest commit.
We've never encountered the invalid parameter issue. Can you try printing trans_mode[iter_id]
?
trans_mode: tensor([[nan, nan, nan], [nan, nan, nan], [nan, nan, nan], [nan, nan, nan], [nan, nan, nan], [nan, nan, nan], [nan, nan, nan], [nan, nan, nan]], device='cuda:0') trans_mode.shape: torch.Size([8, 3]) trans_cov_tril: tensor([[[1., 0., 0.], [0., 1., 0.], [0., 0., 1.]],
[[1., 0., 0.],
[0., 1., 0.],
[0., 0., 1.]],
[[1., 0., 0.],
[0., 1., 0.],
[0., 0., 1.]],
[[1., 0., 0.],
[0., 1., 0.],
[0., 0., 1.]],
[[1., 0., 0.],
[0., 1., 0.],
[0., 0., 1.]],
[[1., 0., 0.],
[0., 1., 0.],
[0., 0., 1.]],
[[1., 0., 0.],
[0., 1., 0.],
[0., 0., 1.]],
[[1., 0., 0.],
[0., 1., 0.],
[0., 0., 1.]]], device='cuda:0')
trans_cov_tril.shape: torch.Size([8, 3, 3])
Are you testing the pre-trained models? If so, it looks like the model is not loaded correctly. Make sure the load_model
argument in the config file points to the pre-trained checkpoint.
I modified line 13 of epropnp_basic.yaml and it work(another bug ^_^),thanks