没办法了
invalid index of a 0-dim tensor. Use tensor.item() to convert a 0-dim tensor to a Python numbe
invalid index of a 0-dim tensor. Use tensor.item() to convert a 0-dim tensor to a Python numbe
File “demo_origin.py”, line 141, in
print(batch_idx, ‘/’, args.maxIter, ‘:’, nLabels, loss.data[0])
IndexError: invalid index of a 0-dim tensor. Use tensor.item() to convert a 0-dim tensor to a Python number
pytorch版本问题.更新之后不兼容了,将 loss.data[0]修改为loss.item()