Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RuntimeError: The size of tensor a (900) must match the size of tensor b (300) at non-singleton dimension 1 #50

Open
weixiangzhan opened this issue Aug 15, 2020 · 0 comments

Comments

@weixiangzhan
Copy link

(python36) pytorch@pytorch:~/cascade-rcnn_Pytorch$ CUDA_VISIBLE_DEVICES=0 python demo.py exp_name --dataset pascal_voc --net detnet59 --checksession 1 --checkepoch 19 --checkpoint 631 --cuda --soft_nms
Called with args:
Namespace(cascade=False, cfg_file='cfgs/detnet59.yml', checkepoch=19, checkpoint=631, checksession=1, class_agnostic=False, cuda=True, dataset='pascal_voc', exp_name='exp_name', image_dir='demo_images/', load_dir='models/', net='detnet59', result_dir='vis_results/', set_cfgs=None, soft_nms=True)
/home/pytorch/cascade-rcnn_Pytorch/lib/model/utils/config.py:405: YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details.
yaml_cfg = edict(yaml.load(f))
Using config:
{'ANCHOR_RATIOS': [0.5, 1, 2],
'ANCHOR_SCALES': [8, 16, 32],
'CROP_RESIZE_WITH_MAX_POOL': False,
'CUDA': False,
'DATA_DIR': '/home/pytorch/cascade-rcnn_Pytorch/data',
'DEDUP_BOXES': 0.0625,
'DETNET': {'FIXED_BLOCKS': 1, 'MAX_POOL': False},
'EPS': 1e-14,
'EXP_DIR': 'res101',
'FEAT_STRIDE': [16],
'FPN_ANCHOR_SCALES': [32, 64, 128, 256, 512],
'FPN_ANCHOR_STRIDE': 1,
'FPN_FEAT_STRIDES': [4, 8, 16, 32, 64],
'GPU_ID': 0,
'HAS_MASK': True,
'MATLAB': 'matlab',
'MAX_NUM_GT_BOXES': 20,
'MOBILENET': {'DEPTH_MULTIPLIER': 1.0,
'FIXED_LAYERS': 5,
'REGU_DEPTH': False,
'WEIGHT_DECAY': 4e-05},
'PIXEL_MEANS': array([[[0.485, 0.456, 0.406]]]),
'PIXEL_STDS': array([[[0.229, 0.224, 0.225]]]),
'POOLING_MODE': 'align',
'POOLING_SIZE': 14,
'RESNET': {'FIXED_BLOCKS': 1, 'MAX_POOL': False},
'RNG_SEED': 3,
'ROOT_DIR': '/home/pytorch/cascade-rcnn_Pytorch',
'TEST': {'BBOX_REG': True,
'HAS_RPN': True,
'MAX_SIZE': 1000,
'MODE': 'nms',
'NMS': 0.3,
'PROPOSAL_METHOD': 'gt',
'RPN_MIN_SIZE': 16,
'RPN_NMS_THRESH': 0.7,
'RPN_POST_NMS_TOP_N': 300,
'RPN_PRE_NMS_TOP_N': 6000,
'RPN_TOP_N': 5000,
'SCALES': [600],
'SOFT_NMS_METHOD': 1,
'SVM': False},
'TRAIN': {'ASPECT_CROPPING': False,
'ASPECT_GROUPING': False,
'BATCH_SIZE': 128,
'BBOX_INSIDE_WEIGHTS': [1.0, 1.0, 1.0, 1.0],
'BBOX_NORMALIZE_MEANS': [0.0, 0.0, 0.0, 0.0],
'BBOX_NORMALIZE_STDS': [0.1, 0.1, 0.2, 0.2],
'BBOX_NORMALIZE_TARGETS': True,
'BBOX_NORMALIZE_TARGETS_PRECOMPUTED': True,
'BBOX_REG': True,
'BBOX_THRESH': 0.5,
'BG_THRESH_HI': 0.5,
'BG_THRESH_LO': 0.0,
'BIAS_DECAY': False,
'BN_TRAIN': False,
'DISPLAY': 20,
'DOUBLE_BIAS': False,
'FG_FRACTION': 0.25,
'FG_THRESH': 0.5,
'FG_THRESH_2ND': 0.6,
'FG_THRESH_3RD': 0.7,
'GAMMA': 0.1,
'HAS_RPN': True,
'IMS_PER_BATCH': 1,
'LEARNING_RATE': 0.001,
'MAX_SIZE': 1000,
'MOMENTUM': 0.9,
'PROPOSAL_METHOD': 'gt',
'RPN_BATCHSIZE': 256,
'RPN_BBOX_INSIDE_WEIGHTS': [1.0, 1.0, 1.0, 1.0],
'RPN_CLOBBER_POSITIVES': False,
'RPN_FG_FRACTION': 0.5,
'RPN_MIN_SIZE': 8,
'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,
'SCALES': [600],
'SNAPSHOT_ITERS': 5000,
'SNAPSHOT_KEPT': 3,
'SNAPSHOT_PREFIX': 'res101_faster_rcnn',
'STEPSIZE': [30000],
'SUMMARY_INTERVAL': 180,
'TRIM_HEIGHT': 600,
'TRIM_WIDTH': 600,
'TRUNCATED': False,
'USE_ALL_GT': True,
'USE_FLIPPED': True,
'USE_GT': False,
'WEIGHT_DECAY': 0.0001},
'USE_GPU_NMS': True}
load model successfully!
load checkpoint models//detnet59/pascal_voc/exp_name/fpn_1_19_631.pth
demo.py:199: UserWarning: volatile was removed and now has no effect. Use with torch.no_grad(): instead.
im_data = Variable(im_data, volatile=True)
demo.py:200: UserWarning: volatile was removed and now has no effect. Use with torch.no_grad(): instead.
im_info = Variable(im_info, volatile=True)
demo.py:201: UserWarning: volatile was removed and now has no effect. Use with torch.no_grad(): instead.
num_boxes = Variable(num_boxes, volatile=True)
demo.py:202: UserWarning: volatile was removed and now has no effect. Use with torch.no_grad(): instead.
gt_boxes = Variable(gt_boxes, volatile=True)
Loaded Photo: 5 images.
/home/pytorch/anaconda3/envs/python36/lib/python3.6/site-packages/torch/nn/functional.py:1749: UserWarning: Default upsampling behavior when mode=bilinear is changed to align_corners=False since 0.4.0. Please specify align_corners=True if the old behavior is desired. See the documentation of nn.Upsample for details.
"See the documentation of nn.Upsample for details.".format(mode))
/home/pytorch/cascade-rcnn_Pytorch/lib/model/rpn/rpn_fpn.py:79: UserWarning: Implicit dimension choice for softmax has been deprecated. Change the call to include dim=X as an argument.
rpn_cls_prob_reshape = F.softmax(rpn_cls_score_reshape)
/home/pytorch/cascade-rcnn_Pytorch/lib/model/fpn/non_cascade/fpn.py:263: UserWarning: Implicit dimension choice for softmax has been deprecated. Change the call to include dim=X as an argument.
cls_prob = F.softmax(cls_score)
Traceback (most recent call last):
File "demo.py", line 310, in
pred_boxes = bbox_transform_inv(boxes, box_deltas, 1)
File "/home/pytorch/cascade-rcnn_Pytorch/lib/model/rpn/bbox_transform.py", line 118, in bbox_transform_inv
pred_ctr_x = dx * widths.unsqueeze(2) + ctr_x.unsqueeze(2)
RuntimeError: The size of tensor a (900) must match the size of tensor b (300) at non-singleton dimension 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant