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

spacy 2.0.12 / thinc 6.10.3 crashing django on heroku #2631

Closed
kevinzen opened this issue Aug 4, 2018 · 4 comments
Closed

spacy 2.0.12 / thinc 6.10.3 crashing django on heroku #2631

kevinzen opened this issue Aug 4, 2018 · 4 comments

Comments

@kevinzen
Copy link

kevinzen commented Aug 4, 2018

This may be a bug in my code somehow or it may be that I've run across a bug in spacy or thinc. I'm not sure yet.

I'm having an issue with v2.0.12 that I've traced into thinc. pip list shows me:

msgpack (0.5.6)
msgpack-numpy (0.4.3.1)
murmurhash (0.28.0)
regex (2017.4.5)
scikit-learn (0.19.2)
scipy (1.1.0)
spacy (2.0.12)
thinc (6.10.3)

I have code that works fine on my Mac, but fails in production. The stack trace goes into spacy and then into thinc -- and then django literally crashes. This all worked when I used an earlier version of spacy -- this has only come about since I'm attempting to upgrade to v2.0.12.

My requirements.txt file has these lines:

regex==2017.4.5
spacy==2.0.12
scikit-learn==0.19.2
scipy==1.1.0
https:/explosion/spacy-models/releases/download/en_core_web_sm-2.0.0/en_core_web_sm-2.0.0.tar.gz

The last line pulls the en_core_web_sm down during deployment. I'm doing this so I can get those models loaded on Heroku during deployment.

I then load the parser like this:

import en_core_web_sm
en_core_web_sm.load()

Then the stack trace shows the problem here in thinc:

File "spacy/language.py", line 352, in __call__
  doc = proc(doc)
File "pipeline.pyx", line 426, in spacy.pipeline.Tagger.__call__
File "pipeline.pyx", line 438, in spacy.pipeline.Tagger.predict
File "thinc/neural/_classes/model.py", line 161, in __call__
  return self.predict(x)
File "thinc/api.py", line 55, in predict
  X = layer(X)
File "thinc/neural/_classes/model.py", line 161, in __call__
  return self.predict(x)
File "thinc/api.py", line 293, in predict
  X = layer(layer.ops.flatten(seqs_in, pad=pad))
File "thinc/neural/_classes/model.py", line 161, in __call__
  eturn self.predict(x)
File "thinc/api.py", line 55, in predict
  X = layer(X)
File "thinc/neural/_classes/model.py", line 161, in __call__
  return self.predict(x)
File "thinc/neural/_classes/model.py", line 125, in predict
  y, _ = self.begin_update(X)
File "thinc/api.py", line 374, in uniqued_fwd
  Y_uniq, bp_Y_uniq = layer.begin_update(X_uniq, drop=drop)
File "thinc/api.py", line 61, in begin_update
  X, inc_layer_grad = layer.begin_update(X, drop=drop)
File "thinc/neural/_classes/layernorm.py", line 51, in begin_update
  X, backprop_child = self.child.begin_update(X, drop=0.)
File "thinc/neural/_classes/maxout.py", line 69, in begin_update
  output__boc = self.ops.batch_dot(X__bi, W)
File "gunicorn/workers/base.py", line 192, in handle_abort
  sys.exit(1)

Again -- this all works on my laptop.

Is there something wrong with how I'm loading? Or is my version of thinc out of date? If so, what should my requirements.txt file look like?

@kevinzen
Copy link
Author

kevinzen commented Aug 4, 2018

@kevinzen
Copy link
Author

kevinzen commented Aug 4, 2018

@honnibal - does something obvious jump out at you?

@kevinzen
Copy link
Author

kevinzen commented Aug 5, 2018

I was able to track down the underlying issue. It turns out that Heroku had simply aborted the thread because it was taking too long. I'll close this issue.

@kevinzen kevinzen closed this as completed Aug 5, 2018
@lock
Copy link

lock bot commented Sep 4, 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 Sep 4, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant