youngwanLEE / CenterMask

[CVPR 2020] CenterMask : Real-Time Anchor-Free Instance Segmentation
https://arxiv.org/abs/1911.06667
Other
770 stars 124 forks source link

centermask_demo.py: list index out of range #21

Open enhany opened 4 years ago

enhany commented 4 years ago

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
youngwanLEE commented 4 years ago

@enhany

This error occurs when there is no detection result.

Why don't you add try ~ except ?

dragen1860 commented 4 years ago

@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 commented 4 years ago

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

RUkiki commented 4 years ago

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

RUkiki commented 4 years ago

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

dragen1860 commented 4 years ago

@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.

RUkiki commented 4 years ago

@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.

ZhangZhongHuaJJ commented 4 years ago

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

PinxueGuo commented 4 years ago

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......

ZhangZhongHuaJJ commented 4 years ago

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