I encountered the problem as shown in the following pic:
 2
When I tried to change loss.data[0] to loss.item(), but encountered another problem, error message is shown as follows:
 5
How can I solve this, thank you very much.