CenterMask icon indicating copy to clipboard operation
CenterMask copied to clipboard

centermask_demo.py: list index out of range

Open enhany opened this issue 5 years ago • 10 comments

I trained model with custom dataset. "python tools/test_net.py" works fine, shows results. But when I try to run centermask_demo.py to visialize results I get error. Problem is with custom dataset only, pretrained model from site works fine.

cmd line:

py demo\centermask_demo.py --input z:\files\plate\testing\in.mp4 --config-file "configs/centermask/centermask_V_19_eSE_FPN_lite_res600_ms_bs16_4x.yaml" --weights "datasets/model_00100000.pth"

result:

file 0
Traceback (most recent call last):
  File "demo\centermask_demo.py", line 167, in <module>
    main()
  File "demo\centermask_demo.py", line 136, in main
    composite = coco_demo.run_on_opencv_image(img)
  File "e:\files\tmp\CenterMask\demo\predictor.py", line 223, in run_on_opencv_image
    predictions = self.compute_prediction(image)
  File "e:\files\tmp\CenterMask\demo\predictor.py", line 261, in compute_prediction
    prediction = predictions[0]
IndexError: list index out of range

enhany avatar Feb 14 '20 09:02 enhany

@enhany

This error occurs when there is no detection result.

Why don't you add try ~ except ?

youngwanLEE avatar Feb 18 '20 08:02 youngwanLEE

@youngwanLEE Hi, I try your mobv2 pretrained model. But it seems every images got this list index out of range error. It's unnormal. any tips? thank you.

dragen1860 avatar Apr 07 '20 08:04 dragen1860

try add --opts MODEL.WEIGHTS xxx.pth to your command line.

dragen1860 avatar Apr 09 '20 01:04 dragen1860

@dragen1860 Hi, I met the same problem.Did you solve it through use the command line before?

RUkiki avatar May 06 '20 13:05 RUkiki

@enhany Hi, I meet the same problem.Did you solve it?I think maybe you can help me to solve this problem.Thanks.

RUkiki avatar May 11 '20 13:05 RUkiki

@dragen1860 Hi, I met the same problem.Did you solve it through use the command line before?

I cannt remember it clearly. I guess I have solved this as I mentioned above.

dragen1860 avatar May 13 '20 01:05 dragen1860

@dragen1860 Hi, I met the same problem.Did you solve it through use the command line before?

I cannt remember it clearly. I guess I have solved this as I mentioned above.

OK.Thanks,i‘ll try it again.

RUkiki avatar May 13 '20 06:05 RUkiki

i also meet this problem,it seems that the predictions of all images return a none []

ZhangZhongHuaJJ avatar Aug 13 '20 06:08 ZhangZhongHuaJJ

I meet the same problem. And solved it finally. My situation: When I use other .yaml and .pth instead of centermask-lite-M-v2(default), it works. So I think there are some wrongs with the file "centermask-lite-M-v2", or it's really only able to predict nothing from all imgs......

PinxueGuo avatar Aug 30 '20 08:08 PinxueGuo

@BWYWTB Thanks for your sharing,i'll try again

ZhangZhongHuaJJ avatar Aug 30 '20 09:08 ZhangZhongHuaJJ