spaCy/spacy/syntax
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
..
__init__.pxd
__init__.py
_beam_utils.pxd Export hash_state from beam_utils 2019-03-15 15:20:28 +01:00
_beam_utils.pyx Use hash_state in beam 2019-03-15 15:22:58 +01:00
_parser_model.pxd Fix handling of added labels. Resolves #3189 2019-02-24 16:41:41 +01:00
_parser_model.pyx Normalize over all actions in parser, not just valid ones 2019-03-15 15:22:16 +01:00
_state.pxd Fix NER when preset entities cross sentence boundaries (#3379) 2019-03-10 14:53:03 +01:00
_state.pyx Tidy up syntax 2017-10-27 19:45:57 +02:00
arc_eager.pxd WIP on stringstore change. 27 failures 2017-05-28 14:06:40 +02:00
arc_eager.pyx Tidy up property code style (#3391) 2019-03-11 15:59:09 +01:00
ner.pxd WIP on stringstore change. 27 failures 2017-05-28 14:06:40 +02:00
ner.pyx Tidy up property code style (#3391) 2019-03-11 15:59:09 +01:00
nn_parser.pxd 💫 Better support for semi-supervised learning (#3035) 2018-12-10 16:25:33 +01:00
nn_parser.pyx 💫 Improve error message when model.from_bytes() dies (#4014) 2019-07-24 11:27:34 +02:00
nonproj.pxd
nonproj.pyx Merge master into develop. Big merge, many conflicts -- need to review 2018-04-29 14:49:26 +02:00
stateclass.pxd Fix memory leak in beam parser 2017-11-14 02:11:40 +01:00
stateclass.pyx Fix memory leak in beam parser 2017-11-14 02:11:40 +01:00
transition_system.pxd Revert "Merge branch 'develop' of https://github.com/explosion/spaCy into develop" 2018-03-27 19:23:02 +02:00
transition_system.pyx 💫 Make serialization methods consistent (#3385) 2019-03-10 19:16:45 +01:00