Using fastai with a dependency manager (e.g. Poetry / pipenv)

Hey there,

Anyone here with experience using fast.ai with a dependency manager such as Poetry / Pipenv. I’ve tries it with both and the dependency resolution takes an extremely long time, and sometimes even fails. Installing Torch first and only then installing fast.ai seems to make it work faster, which is a bit unintuitive, but it still takes a long time.

Would love comments from people who have experience with this.

Cheers,
Avi

I can confirm the slow time to resolve the dependencies in poetry, when starting from a few environment.

$ poetry add fastai2
Creating virtualenv atest-3ZheteDe-py3.7 in /home/gianluca/.cache/pypoetry/virtualenvs
Using version ^0.0.7 for fastai2

Updating dependencies
Resolving dependencies... (18.9s)

Writing lock file


Package operations: 45 installs, 0 updates, 0 removals

  - Installing cymem (2.0.3)
  - Installing murmurhash (1.0.2)
  - Installing numpy (1.18.1)
  - Installing zipp (2.1.0)
  - Installing blis (0.4.1)
  - Installing certifi (2019.11.28)
  - Installing chardet (3.0.4)
  - Installing future (0.18.2)
  - Installing idna (2.8)
  - Installing importlib-metadata (1.5.0)
  - Installing plac (1.1.3)
  - Installing preshed (3.0.2)
  - Installing six (1.14.0)
  - Installing srsly (1.0.1)
  - Installing tqdm (4.42.1)
  - Installing urllib3 (1.25.8)
  - Installing wasabi (0.6.0)
  - Installing catalogue (1.0.0)
  - Installing cycler (0.10.0)
  - Installing joblib (0.14.1)
  - Installing kiwisolver (1.1.0)
  - Installing pillow (7.0.0)
  - Installing pyparsing (2.4.6)
  - Installing python-dateutil (2.8.1)
  - Installing pytz (2019.3)
  - Installing requests (2.22.0)
  - Installing scipy (1.4.1)
  - Installing thinc (7.3.1)
  - Installing torch (1.3.1)
  - Installing attrs (19.3.0)
  - Installing fastcore (0.1.10)
  - Installing fastprogress (0.2.2)
  - Installing matplotlib (3.1.3)
  - Installing more-itertools (8.2.0)
  - Installing packaging (20.1)
  - Installing pandas (1.0.0)
  - Installing pluggy (0.13.1)
  - Installing py (1.8.1)
  - Installing pyyaml (5.3)
  - Installing scikit-learn (0.22.1)
  - Installing spacy (2.2.3)
  - Installing torchvision (0.4.2)
  - Installing wcwidth (0.1.8)
  - Installing fastai2 (0.0.7)
  - Installing pytest (5.3.5)

When first installing pytorch and torchvision though, the process takes only a few milliseconds.

1 Like

Curious about whether you found a workable solution for you. Did you stick with poetry or are you using pipenv? It seems this isn’t completely a solved problem yet.