ERROR:Can't parse 'pt1'. Sequence item with index 0 has a wrong type
Huleyun opened this issue · 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) 👎 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(#397)?
Convert whatever your parameters are to Integer type
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])), ...
Convert whatever your parameters are to Integer type
Yeah I works for me. Thank you
i am having the same error, did you solve it ?