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

Expected object of type torch.cuda.FloatTensor but found type torch.cuda.DoubleTensor for argument #2 'other' #94

Closed
qiangruoyu opened this issue Nov 3, 2018 · 1 comment

Comments

@qiangruoyu
Copy link

I want to use my datasets . so I save my data to a pickle file (train.pkl) According to example Provided by https://github.com/open-mmlab/mmdetection。 But I meet one error , I try my best to solve the problem and It still doesn't work. Please give me some advice.

2018-11-03 21:57:09,580 - INFO - workflow: [('train', 1)], max: 5 epochs
Traceback (most recent call last):
File "tools/train.py", line 81, in
main()
File "tools/train.py", line 77, in main
logger=logger)
File "/home/dezheng/.local/lib/python3.6/site-packages/mmdet-0.5.2+86e25e4-py3.6.egg/mmdet/apis/train.py", line 59, in train_detector
_non_dist_train(model, dataset, cfg, validate=validate)
File "/home/dezheng/.local/lib/python3.6/site-packages/mmdet-0.5.2+86e25e4-py3.6.egg/mmdet/apis/train.py", line 117, in _non_dist_train
runner.run(data_loaders, cfg.workflow, cfg.total_epochs)
File "/home/dezheng/anaconda3/lib/python3.6/site-packages/mmcv/runner/runner.py", line 349, in run
epoch_runner(data_loaders[i], **kwargs)
File "/home/dezheng/anaconda3/lib/python3.6/site-packages/mmcv/runner/runner.py", line 255, in train
self.model, data_batch, train_mode=True, **kwargs)
File "/home/dezheng/.local/lib/python3.6/site-packages/mmdet-0.5.2+86e25e4-py3.6.egg/mmdet/apis/train.py", line 37, in batch_processor
losses = model(**data)
File "/home/dezheng/anaconda3/lib/python3.6/site-packages/torch/nn/modules/module.py", line 477, in call
result = self.forward(*input, **kwargs)
File "/home/dezheng/anaconda3/lib/python3.6/site-packages/torch/nn/parallel/data_parallel.py", line 121, in forward
return self.module(*inputs[0], **kwargs[0])
File "/home/dezheng/anaconda3/lib/python3.6/site-packages/torch/nn/modules/module.py", line 477, in call
result = self.forward(*input, **kwargs)
File "/home/dezheng/.local/lib/python3.6/site-packages/mmdet-0.5.2+86e25e4-py3.6.egg/mmdet/models/detectors/base.py", line 79, in forward
return self.forward_train(img, img_meta, **kwargs)
File "/home/dezheng/.local/lib/python3.6/site-packages/mmdet-0.5.2+86e25e4-py3.6.egg/mmdet/models/detectors/two_stage.py", line 95, in forward_train
rpn_losses = self.rpn_head.loss(*rpn_loss_inputs)
File "/home/dezheng/.local/lib/python3.6/site-packages/mmdet-0.5.2+86e25e4-py3.6.egg/mmdet/models/rpn_heads/rpn_head.py", line 159, in loss
self.target_means, self.target_stds, cfg)
File "/home/dezheng/.local/lib/python3.6/site-packages/mmdet-0.5.2+86e25e4-py3.6.egg/mmdet/core/anchor/anchor_target.py", line 41, in anchor_target
img_metas, means_replicas, stds_replicas, cfg_replicas)
File "/home/dezheng/.local/lib/python3.6/site-packages/mmdet-0.5.2+86e25e4-py3.6.egg/mmdet/core/utils/misc.py", line 24, in multi_apply
return tuple(map(list, zip(*map_results)))
File "/home/dezheng/.local/lib/python3.6/site-packages/mmdet-0.5.2+86e25e4-py3.6.egg/mmdet/core/anchor/anchor_target.py", line 83, in anchor_target_single
_, sampling_result = assign_and_sample(anchors, gt_bboxes, None, None, cfg)
File "/home/dezheng/.local/lib/python3.6/site-packages/mmdet-0.5.2+86e25e4-py3.6.egg/mmdet/core/bbox/sampling.py", line 30, in assign_and_sample
gt_labels)
File "/home/dezheng/.local/lib/python3.6/site-packages/mmdet-0.5.2+86e25e4-py3.6.egg/mmdet/core/bbox/assignment.py", line 66, in assign
overlaps = bbox_overlaps(bboxes, gt_bboxes)
File "/home/dezheng/.local/lib/python3.6/site-packages/mmdet-0.5.2+86e25e4-py3.6.egg/mmdet/core/bbox/geometry.py", line 50, in bbox_overlaps
lt = torch.max(bboxes1[:, None, :2], bboxes2[:, :2]) # [rows, cols, 2]
RuntimeError: Expected object of type torch.cuda.FloatTensor but found type torch.cuda.DoubleTensor for argument #2 'other'

@haoran1062
Copy link

print bboxes.dtype, if dtype is 'float64', change it to 'float32' maybe work

@hellock hellock closed this as completed Oct 26, 2019
CjayBillones pushed a commit to CjayBillones/mmdetection that referenced this issue Feb 18, 2021
…moving_word_spotting_from_metrics

avoid removing word spotting from metrics
FANGAreNotGnu pushed a commit to FANGAreNotGnu/mmdetection that referenced this issue Oct 23, 2023
* transform wip

* mnist demo

* cv tutorial on cpu

* for demo

* wip

* kaggle patch

* handle trunked

* method

* python dependencies

* miscs

* add catboost

* rm ag.done
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

3 participants