In Chp14_Computer_Vision Single_Shot_Multibox_Detection.ipynb in the implementation of Define Loss and Evaluation Functions there is a missing .long() on line 61. A TypeError was raised: "Expected Long but got Float"
I solved it by changing class_true_i[0, j] to class_true_i[0, j].long() because class_target is a tensor with dtype long as shown on line 54 class_target = torch.zeros(class_hat_i.shape[0]).long().to(self.device)
In Chp14_Computer_Vision Single_Shot_Multibox_Detection.ipynb in the implementation of Define Loss and Evaluation Functions there is a missing .long() on line 61. A TypeError was raised: "Expected Long but got Float"
I solved it by changing
class_true_i[0, j]
toclass_true_i[0, j].long()
becauseclass_target
is a tensor with dtype long as shown on line 54class_target = torch.zeros(class_hat_i.shape[0]).long().to(self.device)