Done!
Traceback (most recent call last):
File "train.py", line 112, in
train(epoch)
File "train.py", line 25, in train
data = (data - data.min().data[0]) / (data.max().data[0] - data.min().data[0])
IndexError: invalid index of a 0-dim tensor. Use tensor.item() to convert a 0-dim tensor to a Python number
so , I changed the code (as below)
data.min().data[0] -> data.min()
.data[0] -> .item() ( * Denotes all variables that use data [0].)
Does this deviate from your intention in your code? @emited
Error message :
Done! Traceback (most recent call last): File "train.py", line 112, in
train(epoch)
File "train.py", line 25, in train
data = (data - data.min().data[0]) / (data.max().data[0] - data.min().data[0])
IndexError: invalid index of a 0-dim tensor. Use tensor.item() to convert a 0-dim tensor to a Python number
so , I changed the code (as below)
data.min().data[0] -> data.min()
.data[0] -> .item() ( * Denotes all variables that use data [0].)
Does this deviate from your intention in your code? @emited