You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
File "torchcv-master/examples/fpnssd/train.py", line 37, in
box_coder = FPNSSDBoxCoder()
File "/torchcv-master/torchcv/models/fpnssd/box_coder.py", line 15, in init
self.anchor_boxes = self._get_anchor_boxes(input_size=torch.tensor([512.,512.]))
File "torchcv-master/torchcv/models/fpnssd/box_coder.py", line 57, in _get_anchor_boxes
xy = (xy * grid_size)
RuntimeError: expected backend CPU and dtype Float but got backend CPU and dtype Long
i am getting this any suggestion or anyone faced the issue and solved it.
The text was updated successfully, but these errors were encountered:
Hi
I solved the issue by making the following changes.
in meshgrid.py make following changes into the meshgrid function so that return value of the function is also float.
def meshgrid(x, y, row_major=True):
aa = x * 1.
bb = y * 1.
a = torch.arange(0,aa)
b = torch.arange(0,bb)
xx = a.repeat(y).view(-1,1)
yy = b.view(-1,1).repeat(1,x).view(-1,1)
return torch.cat([xx,yy],1) if row_major else torch.cat([yy,xx],1)
File "torchcv-master/examples/fpnssd/train.py", line 37, in
box_coder = FPNSSDBoxCoder()
File "/torchcv-master/torchcv/models/fpnssd/box_coder.py", line 15, in init
self.anchor_boxes = self._get_anchor_boxes(input_size=torch.tensor([512.,512.]))
File "torchcv-master/torchcv/models/fpnssd/box_coder.py", line 57, in _get_anchor_boxes
xy = (xy * grid_size)
RuntimeError: expected backend CPU and dtype Float but got backend CPU and dtype Long
i am getting this any suggestion or anyone faced the issue and solved it.
The text was updated successfully, but these errors were encountered: