仅作为记录,大佬请跳过。 用 q=torch.argmax(pred_target, 1) list(q.cpu().detach().numpy()) 参考 其中.detach()好像是为了不再有梯度——传送门