Sense2vec gives has FIFOcache error

Hi,
I try to run the (old s2v_reddit_2015_md) sense2vec model with the latest version of Prodigy (1.12) with the

~/Venvs/ct-env$ python -m prodigy sense2vec.teach seasonal ~/spaCy\ data/s2v_reddit_2019_lg/s2v_reddit_2019_lg/ --seeds "christmas, easter, halloween, back-to-school"

Traceback (most recent call last):
File "/usr/lib/python3.8/runpy.py", line 185, in _run_module_as_main
mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
File "/usr/lib/python3.8/runpy.py", line 144, in _get_module_details
return _get_module_details(pkg_main_name, error)
File "/usr/lib/python3.8/runpy.py", line 111, in _get_module_details
import(pkg_name)
File "/home/ahe/.local/lib/python3.8/site-packages/prodigy/init.py", line 7, in
from . import recipes
File "/home/ahe/.local/lib/python3.8/site-packages/prodigy/recipes/init.py", line 1, in
from . import dep, ner, textcat, pos, sent, compare, terms, generic, image # noqa
File "/home/ahe/.local/lib/python3.8/site-packages/prodigy/recipes/dep.py", line 12, in
from ..components.loaders import get_stream
File "cython_src/prodigy/components/loaders.pyx", line 11, in init prodigy.components.loaders
File "/home/ahe/.local/lib/python3.8/site-packages/prodigy/app.py", line 23, in
from .core import Controller
File "cython_src/prodigy/core.pyx", line 9, in init prodigy.core
File "cython_src/prodigy/components/feeds.pyx", line 2, in init prodigy.components.feeds
ImportError: cannot import name FIFOCache

For some reason Prodigy is not happy, and I have no clue where to start the search for the error. Suggestions?

thanks,

Andreas

Hi! It looks like you might have ended up with a missing dependency that wasn't installed after upgrading? Could you try running pip install "cachetools>=2.1.0" manually?

Hi,
Unfortunately installing the cachtools did not work. Since everything did work nicely at Prodigy 1.10 / spacy2.3 I install tose instead (and numpy 1.20, needed for the numba package). The error message

cannot import name 'Schema' from 'pydantic'
Traceback (most recent call last):
File "/usr/lib/python3.8/runpy.py", line 185, in _run_module_as_main
mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
File "/usr/lib/python3.8/runpy.py", line 144, in _get_module_details
return _get_module_details(pkg_main_name, error)
File "/usr/lib/python3.8/runpy.py", line 111, in _get_module_details
import(pkg_name)
File "/home/ahe/.local/lib/python3.8/site-packages/prodigy/init.py", line 7, in
from . import recipes
File "/home/ahe/.local/lib/python3.8/site-packages/prodigy/recipes/init.py", line 4, in
from ..deprecated import recipes # noqa
File "/home/ahe/.local/lib/python3.8/site-packages/prodigy/deprecated/recipes.py", line 9, in
from ..core import recipe
File "cython_src/prodigy/core.pyx", line 12, in init prodigy.core
File "cython_src/prodigy/components/feeds.pyx", line 8, in init prodigy.components.feeds
File "/home/ahe/.local/lib/python3.8/site-packages/prodigy/components/validate.py", line 5, in
from ..types import TextTask, ClassificationTask, ImageTask, SpansTask, SpansManualTask
File "/home/ahe/.local/lib/python3.8/site-packages/prodigy/types.py", line 3, in
from pydantic import validator, BaseModel, Field, Schema
ImportError: cannot import name 'Schema' from 'pydantic' (/home/ahe/.local/lib/python3.8/site-packages/pydantic/init.cpython-38-x86_64-linux-gnu.so)

So still stuck. Are the old reddit models just too old (could be)? If that's the case I'll just have to start with a manual pattern file for the labels

Which Python version are you using? It definitely fails on from cachetools import FIFOCache for you so there must be something going on here. It's weird, though, because we test on all Python version/platform combinations.

This error is also related to the third-party dependencies and I think you ended up with a mismatched version of pydantic/Prodigy in your environment. Upgrading Prodigy to v1.10.7+ or downgrading pydantic should help:

Hi Ines,

thanks, your suggestions did the trick. I downgraded Prodigy to 1.10.6, numpy to 1.20 and Pydantic to 1.7 and it runs smoothly now. Now finding a good strategy for annotation

thanks agian

Andreas