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: Expected object of scalar type Byte but got scalar type Bool for argument #2 'other' #5

Open
mejihero opened this issue Oct 2, 2019 · 1 comment

Comments

@mejihero
Copy link

mejihero commented Oct 2, 2019

Hi Tony607,

Thank you for this mmdetection object detection demo. I got an issue when running the demo: !python tools/train.py {config_fname}

got these errors:
2019-10-02 09:08:06,271 - INFO - Distributed training: False
2019-10-02 09:08:06,683 - INFO - load model from: modelzoo://resnet50
/usr/local/lib/python3.6/dist-packages/mmcv/runner/checkpoint.py:155: UserWarning: The URL scheme of "modelzoo://" is deprecated, please use "torchvision://" instead
warnings.warn('The URL scheme of "modelzoo://" is deprecated, please '
2019-10-02 09:08:06,985 - WARNING - The model and loaded state dict do not match exactly

unexpected key in source state_dict: fc.weight, fc.bias

2019-10-02 09:08:09,667 - INFO - Start running, host: root@aac8453041fd, work_dir: /content/mmdetection_object_detection_demo/mmdetection/work_dirs/faster_rcnn_r50_fpn_1x_voc0712
2019-10-02 09:08:09,668 - INFO - workflow: [('train', 1)], max: 8 epochs
Traceback (most recent call last):
File "tools/train.py", line 98, in
main()
File "tools/train.py", line 94, in main
logger=logger)
File "/usr/local/lib/python3.6/dist-packages/mmdet-0.6.0+5b9c5dd-py3.6-linux-x86_64.egg/mmdet/apis/train.py", line 62, in train_detector
_non_dist_train(model, dataset, cfg, validate=validate)
File "/usr/local/lib/python3.6/dist-packages/mmdet-0.6.0+5b9c5dd-py3.6-linux-x86_64.egg/mmdet/apis/train.py", line 223, in _non_dist_train
runner.run(data_loaders, cfg.workflow, cfg.total_epochs)
File "/usr/local/lib/python3.6/dist-packages/mmcv/runner/runner.py", line 358, in run
epoch_runner(data_loaders[i], **kwargs)
File "/usr/local/lib/python3.6/dist-packages/mmcv/runner/runner.py", line 264, in train
self.model, data_batch, train_mode=True, **kwargs)
File "/usr/local/lib/python3.6/dist-packages/mmdet-0.6.0+5b9c5dd-py3.6-linux-x86_64.egg/mmdet/apis/train.py", line 40, in batch_processor
losses = model(**data)
File "/usr/local/lib/python3.6/dist-packages/torch/nn/modules/module.py", line 547, in call
result = self.forward(*input, **kwargs)
File "/usr/local/lib/python3.6/dist-packages/torch/nn/parallel/data_parallel.py", line 150, in forward
return self.module(*inputs[0], **kwargs[0])
File "/usr/local/lib/python3.6/dist-packages/torch/nn/modules/module.py", line 547, in call
result = self.forward(*input, **kwargs)
File "/usr/local/lib/python3.6/dist-packages/mmdet-0.6.0+5b9c5dd-py3.6-linux-x86_64.egg/mmdet/core/fp16/decorators.py", line 49, in new_func
return old_func(*args, **kwargs)
File "/usr/local/lib/python3.6/dist-packages/mmdet-0.6.0+5b9c5dd-py3.6-linux-x86_64.egg/mmdet/models/detectors/base.py", line 86, in forward
return self.forward_train(img, img_meta, **kwargs)
File "/usr/local/lib/python3.6/dist-packages/mmdet-0.6.0+5b9c5dd-py3.6-linux-x86_64.egg/mmdet/models/detectors/two_stage.py", line 108, in forward_train
*rpn_loss_inputs, gt_bboxes_ignore=gt_bboxes_ignore)
File "/usr/local/lib/python3.6/dist-packages/mmdet-0.6.0+5b9c5dd-py3.6-linux-x86_64.egg/mmdet/models/anchor_heads/rpn_head.py", line 51, in loss
gt_bboxes_ignore=gt_bboxes_ignore)
File "/usr/local/lib/python3.6/dist-packages/mmdet-0.6.0+5b9c5dd-py3.6-linux-x86_64.egg/mmdet/core/fp16/decorators.py", line 127, in new_func
return old_func(*args, **kwargs)
File "/usr/local/lib/python3.6/dist-packages/mmdet-0.6.0+5b9c5dd-py3.6-linux-x86_64.egg/mmdet/models/anchor_heads/anchor_head.py", line 179, in loss
sampling=self.sampling)
File "/usr/local/lib/python3.6/dist-packages/mmdet-0.6.0+5b9c5dd-py3.6-linux-x86_64.egg/mmdet/core/anchor/anchor_target.py", line 63, in anchor_target
unmap_outputs=unmap_outputs)
File "/usr/local/lib/python3.6/dist-packages/mmdet-0.6.0+5b9c5dd-py3.6-linux-x86_64.egg/mmdet/core/utils/misc.py", line 24, in multi_apply
return tuple(map(list, zip(*map_results)))
File "/usr/local/lib/python3.6/dist-packages/mmdet-0.6.0+5b9c5dd-py3.6-linux-x86_64.egg/mmdet/core/anchor/anchor_target.py", line 108, in anchor_target_single
cfg.allowed_border)
File "/usr/local/lib/python3.6/dist-packages/mmdet-0.6.0+5b9c5dd-py3.6-linux-x86_64.egg/mmdet/core/anchor/anchor_target.py", line 169, in anchor_inside_flags
(flat_anchors[:, 2] < img_w + allowed_border) &
RuntimeError: Expected object of scalar type Byte but got scalar type Bool for argument #2 'other'

Do you have any hints to fix it out?

@simonMadec
Copy link

@mejihero Did you find a fix for this bug? I am having the same problem...

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

2 participants