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

ValueError: need more than 1 value to unpack #54

Open
masakuri opened this issue Dec 13, 2017 · 6 comments
Open

ValueError: need more than 1 value to unpack #54

masakuri opened this issue Dec 13, 2017 · 6 comments

Comments

@masakuri
Copy link

When I predicted with English test file, it worked.
But when I predicted with Japanese test file (and set pre-trained Japanese word embeddings file), I got the following error.

  File "build/bdist.linux-x86_64/egg/deepcrf/__init__.py", line 119, in predict
  File "build/bdist.linux-x86_64/egg/deepcrf/main.py", line 149, in run
  File "build/bdist.linux-x86_64/egg/deepcrf/util.py", line 65, in load_vocab
ValueError: need more than 1 value to unpack

My command is like:
deep-crf predict input_test_jp.txt --delimiter=" " --model_filename ./save_jpmodel_dir/bilstm-cnn-crf_adam_jp_epoch41.model --save_dir save_jpmodel_dir --save_name bilstm-cnn-crf_adam_jp --word_emb_file jp_word_emb300.txt --n_word_emb 300 --word_emb_vocab_type replace_only --predicted_output predicted41_jp.txt --gpu 0

Any ideas? Thank you.

@aonotas
Copy link
Owner

aonotas commented Dec 13, 2017

OK. please let me know following information

ls -lr ./save_jpmodel_dir/
head ./save_jpmodel_dir/bilstm-cnn-crf_adam_jp.vocab_char

Please tell me your .vocab_char file contains '\t' ?

@aonotas
Copy link
Owner

aonotas commented Dec 13, 2017

I just fix the code now.
0fec504

So please try recent version.

aonotas added a commit that referenced this issue Dec 13, 2017
@masakuri
Copy link
Author

It worked!
Thank you very much.

aonotas added a commit that referenced this issue Dec 13, 2017
@aonotas
Copy link
Owner

aonotas commented Dec 13, 2017

Thank you.
I fix code again.
please try to use recent version again.
Maybe you char_file contains :
CHAR \t CHAR \t Index.

@masakuri
Copy link
Author

Recent version is also worked. Thank you very much.
I checked my char_file (bilstm-cnn-crf_adam_jp.vocab_char) but I could not find CHAR[tab]CHAR [tab]Index.

@masakuri
Copy link
Author

masakuri commented Dec 13, 2017

I found an following unusual example but I could not find CHAR[tab]CHAR[tab]Index ones.
<U+0080>[tab]438
Maybe this is the cause. I don't know.

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

2 participants