Closed GabrielLin closed 6 years ago
Hi! It looks that something is wrong with your PyGame. I also discovered some errors of my code. I am fixing the stuffs and rewriting the graphical part to make it more efficient. I will let you know when it is done.
It is fixed now. Please let me know if there are any further problems.
Thanks. After I update the change. There is no error when training and test. But when I tag sentence with
python tagger.py tag -p ud1 -r raw.txt -m model_ud1 -emb Embeddings/glove.txt -opth tagged_file.txt
the following error has been shown:
('Encoding: ', 'utf-8') Numbers of sentences: 2. Longest sentence is 139. ALSA lib confmisc.c:768:(parse_card) cannot find card '0' ALSA lib conf.c:4371:(_snd_config_evaluate) function snd_func_card_driver returned error: Permission denied ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings ALSA lib conf.c:4371:(_snd_config_evaluate) function snd_func_concat returned error: Permission denied ALSA lib confmisc.c:1251:(snd_func_refer) error evaluating name ALSA lib conf.c:4371:(_snd_config_evaluate) function snd_func_refer returned error: Permission denied ALSA lib conf.c:4850:(snd_config_expand) Evaluate error: Permission denied ALSA lib pcm.c:2266:(snd_pcm_open_noupdate) Unknown PCM default Traceback (most recent call last): File "tagger.py", line 420, in
new_pixels = toolbox.get_new_pixels(new_chars, font, pic_size) File "/data1/myname/nlp/tagger/toolbox.py", line 468, in get_new_pixels rtext = ft.render(ch.decode('utf-8'), True, (0, 0, 0), (255, 255, 255)) pygame.error: Text has zero width
What is your pygame version and how you install that version?
It works fine on my machine. My pygame version is 1.9.2b8.
I have found the problem. It is the BOM of UTF-8. Removing the BOM or using 'utf-8-sig' to load the file can fix this issue.
I add -pt parameter for the training command:
python -u tagger.py train -p ud1 -t train.txt -d dev.txt -wv -cp -rd -pt -gru -m model_ud1 -emb Embeddings/glove.txt
The above error has been shown. Could you help? Thanks.