报错RuntimeError: Expected object of device type cuda but got device type cpu for argument #3 'weight' in call to _thnn_nll_loss_forward
先说启发:要仔细看报错啊,这个报错是weight,而晚上都是#2等的报错
报错
RuntimeError: Expected object of device type cuda but got device type cpu for argument #3 ‘weight’ in call to _thnn_nll_loss_forward
思路
简单来说,就是weight放到了cpu上面
修改前
criterion = torch.nn.CrossEntropyLoss(weight=torch.tensor([1,7],</