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

Problem with init_model #1928

Closed
azarezade opened this issue Feb 3, 2018 · 1 comment
Closed

Problem with init_model #1928

azarezade opened this issue Feb 3, 2018 · 1 comment
Labels
bug Bugs and behaviour differing from documentation

Comments

@azarezade
Copy link
Contributor

azarezade commented Feb 3, 2018

I am trying to train a model for Persian (fa) language. I prepared the freqs, brown cluster and word2vec data using the instructions here. Then following the doc, I used:

python -m spacy init-model fa data/model/fa/ data/model/fa/fa_wiki.freqs -c data/model/fa/brown/paths -v data/model/fa/fa_wiki.word2vec

But it returns error:

Counting frequencies...
923130it [00:02, 309685.80it/s]
Reading vectors...
108821it [00:11, 9870.09it/s]
Reading clusters...
1047705it [00:47, 22187.37it/s]
Creating model...
100%|██████████████████████████████| 36888/36888 [00:01<00:00, 21654.38it/s]
Traceback (most recent call last):
  File "/usr/lib/python2.7/runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/home/user/Documents/spacy-dev-resources/.venv/lib/python2.7/site-packages/spacy/__main__.py", line 31, in <module>
    plac.call(commands[command], sys.argv[1:])
  File "/home/user/Documents/spacy-dev-resources/.venv/local/lib/python2.7/site-packages/plac_core.py", line 328, in call
    cmd, result = parser.consume(arglist)
  File "/home/user/Documents/spacy-dev-resources/.venv/local/lib/python2.7/site-packages/plac_core.py", line 207, in consume
    return cmd, self.func(*(args + varargs + extraopts), **kwargs)
  File "/home/user/Documents/spacy-dev-resources/.venv/local/lib/python2.7/site-packages/spacy/cli/init_model.py", line 42, in init_model
    nlp = create_model(lang, probs, oov_prob, clusters, vectors_data, vector_keys, prune_vectors)
  File "/home/user/Documents/spacy-dev-resources/.venv/local/lib/python2.7/site-packages/spacy/cli/init_model.py", line 73, in create_model
    nlp.vocab.vectors = Vectors(data=vectors_data, keys=vector_keys)
  File "vectors.pyx", line 56, in spacy.vectors.Vectors.__init__
AttributeError: 'tuple' object has no attribute 'shape'

Environment

  • Operating System: Mac OS X
  • Python Version Used: 3.6
  • spaCy Version Used: 2.0.5
@azarezade azarezade changed the title Problem in training new model with init-model Problem in training new model with init-model Feb 3, 2018
@azarezade azarezade reopened this Feb 3, 2018
@azarezade azarezade changed the title Problem in training new model with init-model Problem with init-model Feb 3, 2018
@azarezade azarezade changed the title Problem with init-model Problem with init_model Feb 3, 2018
azarezade added a commit to azarezade/spaCy that referenced this issue Feb 3, 2018
@azarezade azarezade mentioned this issue Feb 3, 2018
3 tasks
@ines ines added the bug Bugs and behaviour differing from documentation label Feb 3, 2018
ines added a commit that referenced this issue Feb 3, 2018
@lock
Copy link

lock bot commented May 8, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators May 8, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Bugs and behaviour differing from documentation
Projects
None yet
Development

No branches or pull requests

2 participants