1、IndexError: invalid index of a 0-dim tensor. Use tensor.item() to convert a 0-dim tensor to a Python number 解决方案: 将 loss.data[0] 改成 loss.item () 2、RuntimeError: DataLoader worker (pid(s) 19116, 30896) exited unexpectedly 解决方案: 注释掉: num_workers=2