yijingru / BBAVectors-Oriented-Object-Detection

[WACV2021] Oriented Object Detection in Aerial Images with Box Boundary-Aware Vectors
MIT License
467 stars 88 forks source link

我在训练的过程中遇到了AttributeError: 'Tensor' object has no attribute 'bool' #32

Open 18804601171 opened 3 years ago

18804601171 commented 3 years ago

Traceback (most recent call last): File "main.py", line 57, in <module> ctrbox_obj.train_network(args) File "/home/px/PycharmProjects/BBAVectors-Oriented-Object-Detection/train.py", line 132, in train_network criterion=criterion) File "/home/px/PycharmProjects/BBAVectors-Oriented-Object-Detection/train.py", line 167, in run_epoch loss = criterion(pr_decs, data_dict) File "/home/px/anaconda3/envs/px-lab/lib/python3.7/site-packages/torch/nn/modules/module.py", line 493, in __call__ result = self.forward(*input, **kwargs) File "/home/px/PycharmProjects/BBAVectors-Oriented-Object-Detection/loss.py", line 115, in forward wh_loss = self.L_wh(pr_decs['wh'], gt_batch['reg_mask'], gt_batch['ind'], gt_batch['wh']) File "/home/px/anaconda3/envs/px-lab/lib/python3.7/site-packages/torch/nn/modules/module.py", line 493, in __call__ result = self.forward(*input, **kwargs) File "/home/px/PycharmProjects/BBAVectors-Oriented-Object-Detection/loss.py", line 68, in forward mask = mask.unsqueeze(2).expand_as(pred).bool() AttributeError: 'Tensor' object has no attribute 'bool'

yijingru commented 3 years ago

Your version of PyTorch would not match. You can either update the version or change the tensor type.