Invalid Index of 0-dim tensor
Opened this issue · 2 comments
soulslicer commented
losses.update(loss_triplet.data[0], data1.size(0))
IndexError: invalid index of a 0-dim tensor. Use tensor.item() to convert a 0-dim tensor to a Python number
farazBhatti commented
@soulslicer change
'losses.update(loss_triplet.data[0], data1.size(0))'
to
'losses.update(loss_triplet.data, data1.size(0))'
change data[0] to data in all of the code
rafis commented
or to .data.item()