Closed AlanStark closed 5 years ago
Fix by casting grid_size to long
When I train the FPNSSD on my dataset, I encounter the problem of LongTensor / FloatTensor mismatch problem all the time. Does it result from PyTorch Version conflict?
You could fix the issue by casting all floatTensor to longTensor (not that much)
When I train the FPNSSD on my dataset, I encounter the problem as below.
Traceback (most recent call last): File "train.py", line 37, in
box_coder = FPNSSDBoxCoder()
File "/home/masterpy/GitLab/Aerial-Detection/torchcv/models/fpnssd/box_coder.py", line 15, in init
self.anchor_boxes = self._get_anchor_boxes(input_size=torch.tensor([512.,512.]))
File "/home/masterpy/GitLab/Aerial-Detection/torchcv/models/fpnssd/box_coder.py", line 58, in _get_anchor_boxes
xy = (xy*grid_size).view(fm_h,fm_w,1,2).expand(fm_h,fm_w,9,2)
RuntimeError: Expected object of type torch.LongTensor but found type torch.FloatTensor for argument #2 'other'
Could you help me resolve it?