Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

英文数据部分问题 #9

Closed
memorymr opened this issue Apr 25, 2019 · 6 comments
Closed

英文数据部分问题 #9

memorymr opened this issue Apr 25, 2019 · 6 comments

Comments

@memorymr
Copy link

中文数据集成功跑通了,不过英文数据集并没有成功,报错如下:
Traceback (most recent call last):
File "train.py", line 119, in
y = model(sentence,pos1,pos2)
File "/home/jfy/anaconda3/envs/py27/lib/python2.7/site-packages/torch/nn/modules/module.py", line 477, in call
result = self.forward(*input, **kwargs)
File "/home/jfy/下载/NER/BiLSTM_ATT.py", line 63, in forward
embeds = torch.cat((self.word_embeds(sentence),self.pos1_embeds(pos1),self.pos2_embeds(pos2)),2)
File "/home/jfy/anaconda3/envs/py27/lib/python2.7/site-packages/torch/nn/modules/module.py", line 477, in call
result = self.forward(*input, **kwargs)
File "/home/jfy/anaconda3/envs/py27/lib/python2.7/site-packages/torch/nn/modules/sparse.py", line 110, in forward
self.norm_type, self.scale_grad_by_freq, self.sparse)
File "/home/jfy/anaconda3/envs/py27/lib/python2.7/site-packages/torch/nn/functional.py", line 1110, in embedding
return torch.embedding(weight, input, padding_idx, scale_grad_by_freq, sparse)
RuntimeError: index out of range at /opt/conda/conda-bld/pytorch_1535488076166/work/aten/src/TH/generic/THTensorMath.cpp:352

@1216884492
Copy link

我也遇到了这个问题,是通过调整train.py中的POS_SIZE来解决的,您可以尝试一下

@memorymr
Copy link
Author

好的,谢谢

@1216884492
Copy link

1216884492 commented May 14, 2019 via email

@memorymr
Copy link
Author

我在使用的时候也发现了这个问题,目前还没有找到好的解决办法,你可以尝试修改一下学习率和Batch大小,可能会有一点效果。

@1216884492
Copy link

好的,可否加一下您邮箱?想进一步沟通模型使用情况

@buppt buppt closed this as completed May 27, 2019
@memorymr
Copy link
Author

279791061@qq.com

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants