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

IndexError: arrays used as indices must be of integer (or boolean) type #59

Closed
trungtv opened this issue Mar 23, 2018 · 2 comments
Closed

Comments

@trungtv
Copy link

trungtv commented Mar 23, 2018

My env Py 3.6, thinc 6.11.0 caused IndexError for training universal dependency with -v parameters.
However, thinc 6.10 works fine. Please review my log. Thanks

python -m spacy train vi output/ json_format2/vi-ud-train.json json_format2/vi-ud-dev.json -v vi_core_news_md -V 0.0.1 -P -N
Counting training words (limit=None
20285
dropout_from = 0.2 by default
dropout_to = 0.2 by default
dropout_decay = 0.0 by default
batch_from = 1000 by default
batch_to = 1000 by default
batch_compound = 1.001 by default
learn_rate = 0.001 by default
optimizer_B1 = 0.9 by default
optimizer_B2 = 0.999 by default
optimizer_eps = 1e-08 by default
L2_penalty = 1e-06 by default
grad_norm_clip = 1.0 by default
embed_size = 7000 by default
token_vector_width = 128 by default
Itn.	P.Loss	N.Loss	UAS	NER P.	NER R.	NER F.	Tag %	Token %
Saving model...
Traceback (most recent call last):
  File "/Users/trungtv/anaconda3/lib/python3.6/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/Users/trungtv/anaconda3/lib/python3.6/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/Users/trungtv/dev/spaCy/spacy/__main__.py", line 34, in <module>
    plac.call(commands[command], sys.argv[1:])
  File "/Users/trungtv/anaconda3/lib/python3.6/site-packages/plac_core.py", line 328, in call
    cmd, result = parser.consume(arglist)
  File "/Users/trungtv/anaconda3/lib/python3.6/site-packages/plac_core.py", line 207, in consume
    return cmd, self.func(*(args + varargs + extraopts), **kwargs)
  File "/Users/trungtv/dev/spaCy/spacy/cli/train.py", line 132, in train
    drop=next(dropout_rates), losses=losses)
  File "/Users/trungtv/dev/spaCy/spacy/language.py", line 419, in update
    proc.update(docs, golds, drop=drop, sgd=get_grads, losses=losses)
  File "pipeline.pyx", line 486, in spacy.pipeline.Tagger.update
  File "/Users/trungtv/anaconda3/lib/python3.6/site-packages/thinc/api.py", line 61, in begin_update
    X, inc_layer_grad = layer.begin_update(X, drop=drop)
  File "/Users/trungtv/anaconda3/lib/python3.6/site-packages/thinc/api.py", line 280, in begin_update
    drop=drop)
  File "/Users/trungtv/anaconda3/lib/python3.6/site-packages/thinc/api.py", line 61, in begin_update
    X, inc_layer_grad = layer.begin_update(X, drop=drop)
  File "/Users/trungtv/anaconda3/lib/python3.6/site-packages/thinc/api.py", line 377, in uniqued_fwd
    Y_uniq, bp_Y_uniq = layer.begin_update(X_uniq, drop=drop)
  File "/Users/trungtv/anaconda3/lib/python3.6/site-packages/thinc/api.py", line 61, in begin_update
    X, inc_layer_grad = layer.begin_update(X, drop=drop)
  File "/Users/trungtv/anaconda3/lib/python3.6/site-packages/thinc/api.py", line 176, in begin_update
    values = [fwd(X, *a, **k) for fwd in forward]
  File "/Users/trungtv/anaconda3/lib/python3.6/site-packages/thinc/api.py", line 176, in <listcomp>
    values = [fwd(X, *a, **k) for fwd in forward]
  File "/Users/trungtv/anaconda3/lib/python3.6/site-packages/thinc/api.py", line 258, in wrap
    output = func(*args, **kwargs)
  File "/Users/trungtv/anaconda3/lib/python3.6/site-packages/thinc/api.py", line 176, in begin_update
    values = [fwd(X, *a, **k) for fwd in forward]
  File "/Users/trungtv/anaconda3/lib/python3.6/site-packages/thinc/api.py", line 176, in <listcomp>
    values = [fwd(X, *a, **k) for fwd in forward]
  File "/Users/trungtv/anaconda3/lib/python3.6/site-packages/thinc/api.py", line 258, in wrap
    output = func(*args, **kwargs)
  File "/Users/trungtv/anaconda3/lib/python3.6/site-packages/thinc/api.py", line 176, in begin_update
    values = [fwd(X, *a, **k) for fwd in forward]
  File "/Users/trungtv/anaconda3/lib/python3.6/site-packages/thinc/api.py", line 176, in <listcomp>
    values = [fwd(X, *a, **k) for fwd in forward]
  File "/Users/trungtv/anaconda3/lib/python3.6/site-packages/thinc/api.py", line 258, in wrap
    output = func(*args, **kwargs)
  File "/Users/trungtv/anaconda3/lib/python3.6/site-packages/thinc/api.py", line 176, in begin_update
    values = [fwd(X, *a, **k) for fwd in forward]
  File "/Users/trungtv/anaconda3/lib/python3.6/site-packages/thinc/api.py", line 176, in <listcomp>
    values = [fwd(X, *a, **k) for fwd in forward]
  File "/Users/trungtv/anaconda3/lib/python3.6/site-packages/thinc/api.py", line 258, in wrap
    output = func(*args, **kwargs)
  File "/Users/trungtv/anaconda3/lib/python3.6/site-packages/thinc/neural/_classes/static_vectors.py", line 58, in begin_update
    vectors = vector_table[ids * (ids < vector_table.shape[0])]
IndexError: arrays used as indices must be of integer (or boolean) type
@honnibal
Copy link
Member

The 6.11.0 release was broken, but we're still struggling with Windows support, so aren't ready to release a new version. I've deleted 6.11.0 in the meantime.

@honnibal
Copy link
Member

Fixed now.

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