ShulinCao / OpenNRE-PyTorch

Neural Relation Extraction implemented in PyTorch
MIT License
219 stars 45 forks source link

invalid index of a 0-dim tensor #11

Closed juanluis17 closed 5 years ago

juanluis17 commented 5 years ago
return loss.data[0]

IndexError: invalid index of a 0-dim tensor. Use tensor.item() to convert a 0-dim tensor to a Python number

ShulinCao commented 5 years ago

这个是pytorch版本的问题,你可以改下