CenterNet icon indicating copy to clipboard operation
CenterNet copied to clipboard

ERROR:Can't parse 'pt1'. Sequence item with index 0 has a wrong type

Open Huleyun opened this issue 2 years ago • 5 comments

Hello, thanks for this wonderful work. I met a tough problem when I try to use CenterNet in 3D object detection. I run the following command: python demo.py ddd --demo ../images/000003.png --load_model ../models/ddd_3dop.pth

but there interrupt a strange error:

(Python36) wei@wei:~/PycharmProjects/CenterNet/src$ python demo.py ddd --demo ../images/000003.png --load_model ../models/ddd_3dop.pth NMS not imported! If you need it, do cd $CenterNet_ROOT/src/lib/external make NMS not imported! If you need it, do cd $CenterNet_ROOT/src/lib/external make Fix size testing. training chunk_sizes: [32] The output will be saved to /home/wei/PycharmProjects/CenterNet/src/lib/../../exp/ddd/default heads {'hm': 3, 'dep': 1, 'rot': 8, 'dim': 3, 'wh': 2, 'reg': 2} Creating model... loaded ../models/ddd_3dop.pth, epoch 70 THCudaCheck FAIL file=/opt/conda/conda-bld/pytorch_1535491974311/work/aten/src/THC/THCGeneral.cpp line=663 error=11 : invalid argument Traceback (most recent call last): File "demo.py", line 59, in demo(opt) File "demo.py", line 52, in demo ret = detector.run(image_name) File "/home/wei/PycharmProjects/CenterNet/src/lib/detectors/base_detector.py", line 140, in run self.show_results(debugger, image, results) File "/home/wei/PycharmProjects/CenterNet/src/lib/detectors/ddd.py", line 103, in show_results center_thresh=self.opt.vis_thresh, img_id='add_pred') File "/home/wei/PycharmProjects/CenterNet/src/lib/utils/debugger.py", line 330, in add_3d_detection self.imgs[img_id] = draw_box_3d(self.imgs[img_id], box_2d, cl) File "/home/wei/PycharmProjects/CenterNet/src/lib/utils/ddd_utils.py", line 58, in draw_box_3d (corners[f[(j+1)%4], 0], corners[f[(j+1)%4], 1]), c, 2, lineType=cv2.LINE_AA) cv2.error: OpenCV(4.6.0) :-1: error: (-5:Bad argument) in function 'line'

Overload resolution failed:

  • Can't parse 'pt1'. Sequence item with index 0 has a wrong type
  • Can't parse 'pt1'. Sequence item with index 0 has a wrong type

what should I do? do I need to change image to mp4 like issue#397(https://github.com/xingyizhou/CenterNet/issues/397)?

Huleyun avatar Jul 29 '22 07:07 Huleyun

Convert whatever your parameters are to Integer type

AsDeadAsADodo avatar Aug 29 '22 11:08 AsDeadAsADodo

It is most likely that the opencv version is not suitable。 I've had similar problems,The solution is as follows: in draw_box_3d function or other similar error codes,add int(), like this:

cv2.line(image, (int(corners[f[j], 0]), int(corners[f[j], 1])), ...

narwalll avatar Nov 23 '22 08:11 narwalll

Convert whatever your parameters are to Integer type

Yeah I works for me. Thank you

yuzheyao22 avatar Dec 16 '22 10:12 yuzheyao22

Convert whatever your parameters are to Integer type

Hi, i'm already convert to integer but it still fail image

image Coud youu help me pls!

baoga1124 avatar Jan 02 '23 15:01 baoga1124

i am having the same error, did you solve it ?

d7d710 avatar Jan 09 '23 16:01 d7d710