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 Bool but got scalar type Byte for argument #2 'other' in call to _th_and #1

Open
pzs7602 opened this issue Jul 16, 2020 · 0 comments

Comments

@pzs7602
Copy link

pzs7602 commented Jul 16, 2020

I run the classwise semi-supervision demo guided by the readme, I have only one GPU so run the command as:
python shapeprop/tools/train_net.py --config-file configs/coco_voc_mask_rcnn_r50_fpn_1x.yml
and error occurs when executing:

File "/home/pzs/.pyenv/versions/3.7.8/lib/python3.7/runpy.py", line 263, in run_path
pkg_name=pkg_name, script_name=fname)
File "/home/pzs/.pyenv/versions/3.7.8/lib/python3.7/runpy.py", line 96, in _run_module_code
mod_name, mod_spec, pkg_name, script_name)
File "/home/pzs/.pyenv/versions/3.7.8/lib/python3.7/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/home/pzs/pzs/ShapeProp/shapeprop/tools/train_net.py", line 192, in
main()
File "/home/pzs/pzs/ShapeProp/shapeprop/tools/train_net.py", line 185, in main
model = train(cfg, args.local_rank, args.distributed)
File "/home/pzs/pzs/ShapeProp/shapeprop/tools/train_net.py", line 85, in train
arguments,
File "/home/pzs/pzs/ShapeProp/shapeprop/engine/trainer.py", line 69, in do_train
loss_dict = model(images, targets)
File "/home/pzs/.pyenv/versions/3.7.8/lib/python3.7/site-packages/torch/nn/modules/module.py", line 532, in call
result = self.forward(*input, **kwargs)
File "/home/pzs/pzs/ShapeProp/shapeprop/modeling/detector/generalized_rcnn.py", line 56, in forward
x, result, detector_losses = self.roi_heads(features, proposals, targets)
File "/home/pzs/.pyenv/versions/3.7.8/lib/python3.7/site-packages/torch/nn/modules/module.py", line 532, in call
result = self.forward(*input, **kwargs)
File "/home/pzs/pzs/ShapeProp/shapeprop/modeling/roi_heads/roi_heads.py", line 42, in forward
x, detections, loss_mask = self.mask(mask_features, detections, targets)
File "/home/pzs/.pyenv/versions/3.7.8/lib/python3.7/site-packages/torch/nn/modules/module.py", line 532, in call
result = self.forward(*input, **kwargs)
File "/home/pzs/pzs/ShapeProp/shapeprop/modeling/roi_heads/mask_head/mask_head.py", line 77, in forward
loss_mask = self.loss_evaluator(proposals, mask_logits, targets)
File "/home/pzs/pzs/ShapeProp/shapeprop/modeling/roi_heads/mask_head/loss.py", line 119, in call
labels, mask_targets, valid_inds = self.prepare_targets(proposals, targets)
File "/home/pzs/pzs/ShapeProp/shapeprop/modeling/roi_heads/mask_head/loss.py", line 91, in prepare_targets
valid_masks = (labels_per_image > 0) & matched_targets.get_field("valid_masks").to(dtype=torch.uint8)
RuntimeError: Expected object of scalar type Bool but got scalar type Byte for argument #2 'other' in call to _th_and

I think my coco datasets should be configured properly.
Ubuntu 20.04
CUDA 10.0(Nvidia 2080Ti)
PyTorch 1.4.0+cu100
Python 3.7.8

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