KEQA_WSDM19 icon indicating copy to clipboard operation
KEQA_WSDM19 copied to clipboard

IndexError: index out of range in self

Open DW934 opened this issue 10 months ago • 0 comments

when I run test_main.py,I meet the error like this: Traceback (most recent call last): File "test_main.py", line 115, in dete_result, question_list = entity_predict(dataset_iter=test_iter) File "test_main.py", line 41, in entity_predict answer = torch.max(model(data_batch), 1)[1].view(data_batch.ed.size()) File "C:\Users\DW.conda\envs\pytorch\lib\site-packages\torch\nn\modules\module.py", line 1194, in _call_impl return forward_call(*input, **kwargs) File "C:\Code\KEQA_WSDM19-master\entity_detection.py", line 39, in forward x = self.embed(text) File "C:\Users\DW.conda\envs\pytorch\lib\site-packages\torch\nn\modules\module.py", line 1194, in _call_impl return forward_call(*input, **kwargs) File "C:\Users\DW.conda\envs\pytorch\lib\site-packages\torch\nn\modules\sparse.py", line 162, in forward self.norm_type, self.scale_grad_by_freq, self.sparse) File "C:\Users\DW.conda\envs\pytorch\lib\site-packages\torch\nn\functional.py", line 2210, in embedding return torch.embedding(weight, input, padding_idx, scale_grad_by_freq, sparse) IndexError: index out of range in self

I wonder why this error occurs,and what the solution is. Thanks very much!

DW934 avatar Apr 22 '24 12:04 DW934