WXinlong / SOLO

SOLO and SOLOv2 for instance segmentation, ECCV 2020 & NeurIPS 2020.
Other
1.69k stars 307 forks source link

Mask rcnn can't predict #163

Open gcg0210 opened 3 years ago

gcg0210 commented 3 years ago

when I train Mask RCNN . There are warning as follows: UserWarning: indexing with dtype torch.uint8 is now deprecated, please use a dtype torch.bool instead.

And when I run : python tools/test_ins.py configs/mask_rcnn_r50_fpn_1x.py work_dirs0324/ptc/mask_rcnn_r50_fpn_1x6/epoch_500.pth --show --out results_solo.pkl --eval segm

there are a error as follows: File "tools/test_ins.py", line 257, in main() File "tools/test_ins.py", line 217, in main outputs = single_gpu_test(model, data_loader) File "tools/test_ins.py", line 53, in single_gpu_test result = get_masks(seg_result, num_classes=num_classes) File "tools/test_ins.py", line 27, in get_masks seg_pred = cur_result[0].cpu().numpy().astype(np.uint8) AttributeError: 'numpy.ndarray' object has no attribute 'cpu'

It seems that the cur_result[0] is not showing " true or false" such as solov2 .

I don't know how to solve it .please help me.