Skip to content
Discussion options

You must be logged in to vote

Hmm, I can't reproduce this. That line in the code is what tells pickle how to handle Doc objects.

In general, you should use a DocBin to save your docs instead of pickle. It's much more efficient, safe, and portable: https://spacy.io/usage/saving-loading#docs

If you really want to use pickle: my initial guesses might be that the file is corrupted somehow or that there are differences in the environments where you're saving/loading?

If you install all the dev dependencies, you can run a few tests to make sure that nothing is wrong with your install (would be unlikely):

python -m pip install -r https://raw.githubusercontent.com/explosion/spaCy/v3.2.3/requirements.txt
python -m pytest --pya…

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by adrianeboyd
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat / serialize Feature: Serialization, saving and loading feat / doc Feature: Doc, Span and Token objects
2 participants
Converted from issue

This discussion was converted from issue #10533 on March 24, 2022 09:29.