RuntimeError: bool value of Tensor with more than one value is ambiguous loss = nn.CrossEntropy...
深度学习训练模型报错:如题。Debug原来是loss=torch.nn.CrossEntropyLoss(output,target)出了问题。解决方案一:criteria=nn.CrossEntropyLoss()loss=criteria(output,target)解决方案二:loss=torch.nn.functional.cross_entropy(output,target)