When I ran the code, there was an error in the title style. After searching on the Internet, I finally found out that it was a problem with the loss function CrossEntropyLoss(). The problem is that my input type is different, because the input type of the loss function should be long, so the modification method is shown in the figure below
As shown in the figure, I only need to change my labels variable to long type, and the program can continue to run.