1from logger import Logger有警告
2D:\Anaconda3\python.exe G:/pytorch/pytorch-beginner-master/04-Convolutional-Neural-Network/convolution_network.py
epoch 1
Traceback (most recent call last):
File "G:/pytorch/pytorch-beginner-master/04-Convolutional-Neural-Network/convolution_network.py", line 78, in
running_loss += loss.data[0] * label.size(0)
IndexError: invalid index of a 0-dim tensor. Use tensor.item() to convert a 0-dim tensor to a Python number
Process finished with exit code 1


1from logger import Logger有警告
2D:\Anaconda3\python.exe G:/pytorch/pytorch-beginner-master/04-Convolutional-Neural-Network/convolution_network.py
epoch 1
Traceback (most recent call last):
File "G:/pytorch/pytorch-beginner-master/04-Convolutional-Neural-Network/convolution_network.py", line 78, in
running_loss += loss.data[0] * label.size(0)
IndexError: invalid index of a 0-dim tensor. Use tensor.item() to convert a 0-dim tensor to a Python number
Process finished with exit code 1