spaCy/spacy
Matthew Honnibal 73e095923f 💫 Improve error message when model.from_bytes() dies (#4014)
* Improve error message when model.from_bytes() dies

When Thinc's model.from_bytes() is called with a mismatched model, often
we get a particularly ungraceful error,

e.g. "AttributeError: FunctionLayer has no attribute G"

This is because we're trying to load the parameters for something like
a LayerNorm layer, and the model architecture has some other layer there
instead. This is obviously terrible, especially since the error *type*
is wrong.

I've changed it to raise a ValueError. The error message is still
probably a bit terse, but it's hard to be sure exactly what's gone
wrong.

* Update spacy/pipeline/pipes.pyx

* Update spacy/pipeline/pipes.pyx

* Update spacy/pipeline/pipes.pyx

* Update spacy/syntax/nn_parser.pyx

* Update spacy/syntax/nn_parser.pyx

* Update spacy/pipeline/pipes.pyx

Co-Authored-By: Matthew Honnibal <honnibal+gh@gmail.com>

* Update spacy/pipeline/pipes.pyx

Co-Authored-By: Matthew Honnibal <honnibal+gh@gmail.com>


Co-authored-by: Ines Montani <ines@ines.io>
2019-07-24 11:27:34 +02:00
..
cli Merge branch 'master' into feature/nel-wiki 2019-07-09 21:57:47 +02:00
data Make spacy/data a package 2017-03-18 20:04:22 +01:00
displacy Exclude user_data when copying doc in displaCy (closes #3882) 2019-06-26 14:37:05 +02:00
lang Remove old comment (#4012) 2019-07-23 23:10:06 +02:00
matcher 💫 Fix issue #3839: Incorrect entity IDs from Matcher with operators (#3949) 2019-07-11 12:55:11 +02:00
pipeline 💫 Improve error message when model.from_bytes() dies (#4014) 2019-07-24 11:27:34 +02:00
syntax 💫 Improve error message when model.from_bytes() dies (#4014) 2019-07-24 11:27:34 +02:00
tests Merge pull request #4003 from svlandeg/feature/nel-fixes 2019-07-23 23:17:07 +02:00
tokens Fix dependency copy for as_doc (#3969) 2019-07-23 18:28:54 +02:00
__init__.pxd * Seems to be working after refactor. Need to wire up more POS tag features, and wire up save/load of POS tags. 2014-10-24 02:23:42 +11:00
__init__.py Fix formatting (hopefully also restarts build properly) 2019-03-20 09:55:45 +01:00
__main__.py Update __main__.py 2019-03-20 09:43:26 +01:00
_align.pyx Improve alignment around quotes 2018-08-16 01:04:34 +02:00
_ml.py small fix 2019-07-15 12:04:45 +02:00
about.py Increment version [ci skip] 2019-07-12 17:40:00 +02:00
attrs.pxd Fix attrs alignment 2019-07-12 17:59:47 +02:00
attrs.pyx ensure Span.as_doc keeps the entity links + unit test 2019-06-25 15:28:51 +02:00
compat.py Fix symlink creation to show error message on failure (#3589) (resolves #3307)) 2019-04-16 11:58:31 +02:00
errors.py 💫 Improve error message when model.from_bytes() dies (#4014) 2019-07-24 11:27:34 +02:00
glossary.py Update glossary.py to match information found in documentation (#3704) (closes ##3679) 2019-05-10 14:23:20 +02:00
gold.pxd fixes in kb and gold 2019-07-17 17:18:26 +02:00
gold.pyx Merge remote-tracking branch 'upstream/master' into feature/nel-fixes 2019-07-22 13:41:28 +02:00
kb.pxd rename entity frequency 2019-07-19 17:40:28 +02:00
kb.pyx Errors.E146 for IO error when FP is null 2019-07-22 14:56:13 +02:00
language.py remove redundancy 2019-07-03 15:02:10 +02:00
lemmatizer.py Fix inconsistant lemmatizer issue #3484 (#3646) 2019-05-04 18:16:03 +02:00
lexeme.pxd 💫 Support lexical attributes in retokenizer attrs (closes #2390) (#3325) 2019-02-24 21:13:51 +01:00
lexeme.pyx Tidy up property code style (#3391) 2019-03-11 15:59:09 +01:00
morphology.pxd annotate kb_id through ents in doc 2019-03-22 11:36:44 +01:00
morphology.pyx Fix issue #3551: Upper case lemmas 2019-04-16 12:27:15 +02:00
parts_of_speech.pxd Add support for Universal Dependencies v2.0 2017-03-03 13:17:34 +01:00
parts_of_speech.pyx Tidy up rest 2017-10-27 21:07:59 +02:00
scorer.py Bugfix/issue 3968 (#3982) 2019-07-18 00:20:32 +02:00
strings.pxd Try to fix StringStore clean up (see #1506) 2017-11-11 03:11:27 +03:00
strings.pyx 💫 Make serialization methods consistent (#3385) 2019-03-10 19:16:45 +01:00
structs.pxd rename entity frequency 2019-07-19 17:40:28 +02:00
symbols.pxd Fix symbol alignment 2019-07-12 17:48:38 +02:00
symbols.pyx ensure Span.as_doc keeps the entity links + unit test 2019-06-25 15:28:51 +02:00
tokenizer.pxd Disable tokenizer cache for special-cases. Fixes #1250 2017-10-24 16:08:05 +02:00
tokenizer.pyx tokenizer doc fix 2019-07-15 11:19:34 +02:00
typedefs.pxd Work on changing StringStore to return hashes. 2017-05-28 12:36:27 +02:00
typedefs.pyx Tidy up rest 2017-10-27 21:07:59 +02:00
util.py Make jsonschema dependency optional (#3784) 2019-05-30 14:34:58 +02:00
vectors.pyx Update Vectors.find docs [ci skip] 2019-03-16 17:10:57 +01:00
vocab.pxd 💫 Small efficiency fixes to tokenizer (#2587) 2018-07-24 23:35:54 +02:00
vocab.pyx Tidy up property code style (#3391) 2019-03-11 15:59:09 +01:00