NVlabs / Deep_Object_Pose

Deep Object Pose Estimation (DOPE) – ROS inference (CoRL 2018)
Other
1.02k stars 284 forks source link

ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (9,) + inhomogeneous part. #339

Closed thohemp closed 7 months ago

thohemp commented 8 months ago

Hello,

I am working with a custom dataset. Trainings works fine, but when I try the inference script is throws me following error:

ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (9,) + inhomogeneous part.

at line https://github.com/NVlabs/Deep_Object_Pose/blob/master/scripts/train2/inference/detector.py#L485.

Anyone faced the same issue?

Belief map looks good though.

20240117_104158(0)_belief

TontonTremblay commented 8 months ago

it looks like it is due to some new numpy, can you do a clean reshape, something like .reshape(9,2)?

TontonTremblay commented 8 months ago

Your results look very good btw.

thohemp commented 8 months ago

it looks like it is due to some new numpy, can you do a clean reshape, something like .reshape(9,2)?

I think the problem is that in case where the error is raised, points has Nones, e.g.:

[None, None, None, None, None, (57.18119389528066, 160.5283507309974), (61.34432166522373, 181.1726155590992), (214.68325248224997, 185.83047341657362), (122.63500075032445, 205.31441894184206)]
TontonTremblay commented 8 months ago

which version of opencv and numpy are you running?

thohemp commented 8 months ago

which version of opencv and numpy are you running?

opencv-python 4.9.0.80 numpy 1.24.4

thohemp commented 8 months ago

Changing the numpy version to 1.17 made it work! Thanks

TontonTremblay commented 8 months ago

amazing :D