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

训练出错 #3

Open
XudongHou opened this issue Jul 9, 2019 · 9 comments
Open

训练出错 #3

XudongHou opened this issue Jul 9, 2019 · 9 comments

Comments

@XudongHou
Copy link

使用提供的raw数据和自己做的分词数据进行训练都遇到了这样的问题, 请问这个keyError的原因可能是什么?

[training] 136536/498250 [>>>>>>>> ] -0.0s/step loss: 1.4116 [2019-07-08 23:25:35]: cw2vec trainer.py[line:79] INFO saving word2vec vector
save vector: 67%|██████▋ | 8839/13259 [00:00<00:00, 17438.27it/s]
Traceback (most recent call last):
File "E:/workstation/cw2vec-pytorch/train_cw2vec.py", line 95, in
main()
File "E:/workstation/cw2vec-pytorch/train_cw2vec.py", line 76, in main
trainer.train()
File "E:\workstation\cw2vec-pytorch\pycw2vec\train\trainer.py", line 145, in train
self.save()
File "E:\workstation\cw2vec-pytorch\pycw2vec\train\trainer.py", line 87, in save
word = id_word[i]
KeyError: 9965

@hziheng
Copy link

hziheng commented Oct 23, 2019

我也是这个问题,请问您解决了吗

@XudongHou
Copy link
Author

我也是这个问题,请问您解决了吗
字典未含有key,我使用python Dict类的get方法去规避了key error问题,可能是遇见了oov问题吧

@hziheng
Copy link

hziheng commented Oct 30, 2019

我也是这个问题,请问您解决了吗
字典未含有key,我使用python Dict类的get方法去规避了key error问题,可能是遇见了oov问题吧

请问除了这个问题,您在运行这个程序的时候loss值有在下降吗,我运行的时候一直都没有收敛

@XudongHou
Copy link
Author

我也是这个问题,请问您解决了吗
字典未含有key,我使用python Dict类的get方法去规避了key error问题,可能是遇见了oov问题吧

请问除了这个问题,您在运行这个程序的时候loss值有在下降吗,我运行的时候一直都没有收敛

有段时间没跑这个嵌入训练了,记不起来细节了。印象中解决完这个bug其他都是比较顺的。

@hziheng
Copy link

hziheng commented Oct 31, 2019 via email

@klqqq
Copy link

klqqq commented May 20, 2020

我也是这个问题,请问您解决了吗
字典未含有key,我使用python Dict类的get方法去规避了key error问题,可能是遇见了oov问题吧

请问您是怎么规避这个ooV问题的啊,我想跑一个word-similarity的任务,但是就总是出现ValueError: %d not in vocab 这个错

@hziheng
Copy link

hziheng commented May 24, 2020 via email

@Crescentz
Copy link

请问你们训练了多久

@Crescentz
Copy link

使用字典的get方法,可以避免这个错误

------------------ 原始邮件 ------------------ 发件人: "klqqq"<[email protected]>; 发送时间: 2020年5月20日(星期三) 下午3:18 收件人: "lonePatient/cw2vec-pytorch"<[email protected]>; 抄送: "huang"<[email protected]>; "Comment"<[email protected]>; 主题: Re: [lonePatient/cw2vec-pytorch] 训练出错 (#3) 我也是这个问题,请问您解决了吗 字典未含有key,我使用python Dict类的get方法去规避了key error问题,可能是遇见了oov问题吧 请问您是怎么规避这个ooV问题的啊,我想跑一个word-similarity的任务,但是就总是出现ValueError: %d not in vocab 这个错 — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

请问你训练了多久,就是用zhihu.txt么,会不会数据太小了。用wiki的话大概要多久

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

4 participants