TuSimple / mx-maskrcnn

An MXNet implementation of Mask R-CNN

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

while I use my train model to test my dataset, error is " operands could not be broadcast together with shapes (0,0) (174,193)"

napolun279 opened this issue · comments

I try to test my own image,but error found.
anyone can help me. THANKS!!!
jcc@jcc:~/research/mx-maskrcnn$ bash scripts/demo.sh
Namespace(dataset='Cityscape', dataset_path='data/cityscape', epoch=0, gpu=1, has_rpn=True, image_set='test', network='resnet_fpn', prefix='model/final', proposal='rpn', result_path='data/cityscape/results/', root_path='data', shuffle=False, thresh=0.001, vis=False)
{'ANCHOR_RATIOS': [0.5, 1, 2],
'ANCHOR_SCALES': [8],
'CLASS_ID': [0, 23],
'FIXED_PARAMS': ['conv0', 'stage1', 'gamma', 'beta'],
'FIXED_PARAMS_SHARED': ['conv0',
'stage1',
'stage2',
'stage3',
'stage4',
'P5',
'P4',
'P3',
'P2',
'gamma',
'beta'],
'NUM_ANCHORS': 3,
'NUM_CLASSES': 2,
'PIXEL_MEANS': array([0, 0, 0]),
'RCNN_FEAT_STRIDE': [32, 16, 8, 4],
'ROIALIGN': True,
'RPN_FEAT_STRIDE': [64, 32, 16, 8, 4],
'SCALES': [(1024, 2048)],
'TEST': {'BATCH_IMAGES': 1,
'HAS_RPN': True,
'NMS': 0.3,
'PROPOSAL_MIN_SIZE': [64, 32, 16, 8, 4],
'PROPOSAL_NMS_THRESH': 0.7,
'PROPOSAL_POST_NMS_TOP_N': 2000,
'PROPOSAL_PRE_NMS_TOP_N': 20000,
'RPN_MIN_SIZE': [64, 32, 16, 8, 4],
'RPN_NMS_THRESH': 0.7,
'RPN_POST_NMS_TOP_N': 1000,
'RPN_PRE_NMS_TOP_N': 6000},
'TRAIN': {'ASPECT_GROUPING': True,
'BATCH_IMAGES': 1,
'BATCH_ROIS': 256,
'BBOX_MEANS': [0.0, 0.0, 0.0, 0.0],
'BBOX_NORMALIZATION_PRECOMPUTED': False,
'BBOX_REGRESSION_THRESH': 0.5,
'BBOX_STDS': [0.1, 0.1, 0.2, 0.2],
'BBOX_WEIGHTS': array([ 1., 1., 1., 1.]),
'BG_THRESH_HI': 0.3,
'BG_THRESH_LO': 0.0,
'FG_FRACTION': 0.5,
'FG_THRESH': 0.3,
'RPN_BATCH_SIZE': 256,
'RPN_BBOX_WEIGHTS': [1.0, 1.0, 1.0, 1.0],
'RPN_CLOBBER_POSITIVES': False,
'RPN_FG_FRACTION': 0.5,
'RPN_MIN_SIZE': [64, 32, 16, 8, 4],
'RPN_NEGATIVE_OVERLAP': 0.3,
'RPN_NMS_THRESH': 0.7,
'RPN_POSITIVE_OVERLAP': 0.7,
'RPN_POSITIVE_WEIGHT': -1.0,
'RPN_POST_NMS_TOP_N': 2000,
'RPN_PRE_NMS_TOP_N': 12000,
'SCALE': True,
'SCALE_RANGE': [0.8, 1]}}
num_images 18
cityscape_test gt roidb loaded from data/cache/cityscape_test_gt_roidb.pkl
Traceback (most recent call last):
File "demo_mask.py", line 41, in
main()
File "demo_mask.py", line 38, in main
args.vis, args.shuffle, args.has_rpn, args.proposal, args.thresh)
File "/home/jcc/research/mx-maskrcnn/rcnn/tools/demo_maskrcnn.py", line 68, in demo_maskrcnn
pred_demo_mask(predictor, test_data, imdb, roidb, result_path, vis=vis, thresh=thresh)
File "/home/jcc/research/mx-maskrcnn/rcnn/core/tester.py", line 257, in pred_demo_mask
draw_detection_mask(data_dict['data'], boxes_this_image, masks_this_image, scale, filename)
File "/home/jcc/research/mx-maskrcnn/rcnn/core/tester.py", line 319, in draw_detection_mask
target = im[bbox[1]: bbox[3], bbox[0]: bbox[2], c] + mask_color * mask
ValueError: operands could not be broadcast together with shapes (0,0) (174,193)

well, I‘m so stupid!!! I forgot to change the classes in my rcnn/core/tester.py!!!