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

运行weibo数据集报错 #42

Closed
ArlanCooper opened this issue Oct 30, 2020 · 8 comments
Closed

运行weibo数据集报错 #42

ArlanCooper opened this issue Oct 30, 2020 · 8 comments

Comments

@ArlanCooper
Copy link

运行微博数据集报错:
运行命令:python flat_main.py --dataset weibo
image
OSError: [Errno 22] Invalid argument: 'cache\weibo_lattice_only_train:False_trainClip:True_norm_num:0char_min_freq1bigram_min_freq1word_min_freq1only_train_min_freqTruenumber_norm0lexicon_yjload_dataset_seed100'

@LeeSureman
Copy link
Owner

可以试试先在当前目录下新建一个cache文件夹

@ArlanCooper
Copy link
Author

ArlanCooper commented Nov 2, 2020

可以试试先在当前目录下新建一个cache文件夹
尝试了,就是在../V0/ 文件夹下,新建了一个cache的文件夹,然后运行代码,还是报错,同样的错误,
cache文件夹下生成的文件:
image

@Jamrainbow
Copy link

我也遇到这个错误了,请问解决了吗

@ArlanCooper
Copy link
Author

我也遇到这个错误了,请问解决了吗

已经解决了,解决方法:
在windows下面操作,需要修改以下几个地方:

  1. flat_main.py 中,第306行,cache_name中的冒号(:)都替换成井号(#)
cache_name = os.path.join('cache',(args.dataset+'_lattice'+'_only_train#{}'+
                          '_trainClip#{}'+'_norm_num#{}'
                                   +'char_min_freq{}'+'bigram_min_freq{}'+'word_min_freq{}'+'only_train_min_freq{}'
                                   +'number_norm{}'+'lexicon_{}'+'load_dataset_seed{}')

  1. 如果没有GPU,则修改utils.py 第220行添加一行:
device = None

@Jamrainbow
Copy link

Jamrainbow commented Nov 10, 2020 via email

@ArlanCooper
Copy link
Author

感谢感谢,解决了。另外还有两个问题不太确定。 1.你生成的yj文件也是这个样子吗? 2.还有运行的时候Found 698668 out of 698670 words in the pre-training embedding.这个正常吗

------------------ 原始邮件 ------------------ 发件人: "LeeSureman/Flat-Lattice-Transformer" <notifications@github.com>; 发送时间: 2020年11月10日(星期二) 下午3:38 收件人: "LeeSureman/Flat-Lattice-Transformer"<Flat-Lattice-Transformer@noreply.github.com>; 抄送: "Jam Don"<961283609@qq.com>;"Comment"<comment@noreply.github.com>; 主题: Re: [LeeSureman/Flat-Lattice-Transformer] 运行weibo数据集报错 (#42) 我也遇到这个错误了,请问解决了吗 已经解决了,解决方法: 在windows下面操作,需要修改以下几个地方: flat_main.py 中,第306行,cache_name中的冒号(:)都替换成井号(#) cache_name = os.path.join('cache',(args.dataset+'_lattice'+'_only_train#{}'+ '_trainClip#{}'+'norm_num#{}' +'char_min_freq{}'+'bigram_min_freq{}'+'word_min_freq{}'+'only_train_min_freq{}' +'number_norm{}'+'lexicon{}'+'load_dataset_seed{}') 如果没有GPU,则修改utils.py 第220行添加一行: device = None — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

  1. 就是我没看到你发的图,我看了看我的,如果用文本软件打开确实是乱码,应该是二进制文件;
  2. 这个我也不太清楚是否正常,训练的时候我也是这么显示的。

@Jamrainbow
Copy link

Jamrainbow commented Nov 10, 2020 via email

@houyuchao
Copy link

我也遇到这个错误了,请问解决了吗

已经解决了,解决方法: 在windows下面操作,需要修改以下几个地方:

  1. flat_main.py 中,第306行,cache_name中的冒号(:)都替换成井号(#)
cache_name = os.path.join('cache',(args.dataset+'_lattice'+'_only_train#{}'+
                          '_trainClip#{}'+'_norm_num#{}'
                                   +'char_min_freq{}'+'bigram_min_freq{}'+'word_min_freq{}'+'only_train_min_freq{}'
                                   +'number_norm{}'+'lexicon_{}'+'load_dataset_seed{}')
  1. 如果没有GPU,则修改utils.py 第220行添加一行:
device = None

则修改utils.py 第220行添加一行:

device = None我修改了这个,但是出现了这样的报错怎么解决

image

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