cai-lw / KBGAN

Code for "KBGAN: Adversarial Learning for Knowledge Graph Embeddings" https://arxiv.org/abs/1711.04071
MIT License
212 stars 57 forks source link

有个keyError:(tensor(9738),tensor(85))的错误,在base_model.py中test_link函数 #4

Closed zhangyi85 closed 6 years ago

zhangyi85 commented 6 years ago

这个错误指向test_link函数中第111行: if tails[(s, r)]._nnz()>1 猜测是因为没有找到相应的尾节点key值而报错。 请帮忙解决一下,谢谢!

zhangyi85 commented 6 years ago

我用的是torch 0.4.0

cai-lw commented 6 years ago

您好,这个项目暂时没有支持PyTorch的其他版本的计划 您可以改用README中指定的0.2.0版,或者尝试自己修改代码

cai-lw commented 6 years ago

之前有一位提issue的同学@xitongdashi 用PyTorch0.4稍微改了改跑起来了,你可以和他交流一下

zhangyi85 commented 6 years ago

谢谢,换了0.2.0

WeidongLi-KG commented 6 years ago

@zhangyi85 https://github.com/WeidongLi-KG/KBGAN_PyTorch-v0.4.1

WeidongLi-KG commented 6 years ago

@zhangyi85 @cai-lw I have revised the KBGAN code with PyTorch-v0.4.1: https://github.com/WeidongLi-KG/KBGAN_PyTorch-v0.4.1