thunlp / OpenKE

An Open-Source Package for Knowledge Embedding (KE)
3.83k stars 985 forks source link

运行train_transh_FB15k237遇到的问题 #258

Closed SHK92 closed 3 years ago

SHK92 commented 4 years ago

运行源码,会在Trainer.train_one_step()时, File ".\OpenKE\openke\module\model\TransH.py", line 83, in forward h = self.ent_embeddings(batch_h) File ".\Anaconda2\envs\KG_Models_MXnet\lib\site-packages\torch\nn\modules\module.py", line 551, in call result = self.forward(*input, **kwargs) File ".\Anaconda2\envs\KG_Models_MXnet\lib\site-packages\torch\nn\modules\sparse.py", line 114, in forward self.norm_type, self.scale_grad_by_freq, self.sparse) File ".\Anaconda2\envs\KG_Models_MXnet\lib\site-packages\torch\nn\functional.py", line 1724, in embedding return torch.embedding(weight, input, padding_idx, scale_grad_by_freq, sparse) IndexError: index out of range in self

NoSmoKing13 commented 3 years ago

找到原因了吗

LiuYuemei111 commented 3 years ago

运行源码,会在Trainer.train_one_step()时, File ".\OpenKE\openke\module\model\TransH.py", line 83, in forward h = self.ent_embeddings(batch_h) File ".\Anaconda2\envs\KG_Models_MXnet\lib\site-packages\torch\nn\modules\module.py", line 551, in call result = self.forward(*input, **kwargs) File ".\Anaconda2\envs\KG_Models_MXnet\lib\site-packages\torch\nn\modules\sparse.py", line 114, in forward self.norm_type, self.scale_grad_by_freq, self.sparse) File ".\Anaconda2\envs\KG_Models_MXnet\lib\site-packages\torch\nn\functional.py", line 1724, in embedding return torch.embedding(weight, input, padding_idx, scale_grad_by_freq, sparse) IndexError: index out of range in self

Are you running on a window system? Some packages used in C++ do not support compilation on windows. You can use it on Linux system.