New custom dependencies install feature
If you don’t want to install all the fastai dependencies, because you only want the vision
or text
dependencies the custom dependency groups are now automated, so that you can do:
pip selective dependency installation:
pip install --no-deps fastai
pip install $(python setup.py -q deps --dep-groups=core,vision)
same for conda:
conda install --no-deps -c fastai fastai
conda install -c pytorch -c fastai $(python setup.py -q deps --dep-conda --dep-groups=core,vision)
adjust the --dep-groups
argument to match your needs, which you can get from:
python setup.py -q deps
You should get something like:
Available dependency groups: core, text, qrnn, vision
This assumes you’re inside the fastai
git repo.
What happens behind the scenes is:
python setup.py -q deps --dep-groups=core,vision
returns:
Pillow beautifulsoup4 bottleneck dataclasses;python_version<'3.7' fastprogress>=0.1.18 matplotlib numexpr numpy>=1.12 nvidia-ml-py3 packaging pandas pyyaml requests scipy torch>=1.0.0 torchvision typing
There is another option to get the same but quoted output suitable for manual copy-n-paste:
# pip:
python setup.py -q deps --dep-groups=core,vision --dep-quote
# conda:
python setup.py -q deps --dep-groups=core,vision --dep-quote --dep-conda
So the output for pip will look like:
"Pillow" "beautifulsoup4" "bottleneck" "dataclasses;python_version<'3.7'" "fastprogress>=0.1.18" "matplotlib" "numexpr" "numpy>=1.12" "nvidia-ml-py3" "packaging" "pandas" "pyyaml" "requests" "scipy" "torch>=1.0.0" "torchvision" "typing"
I couldn’t figure out how to make the quoted output work with backticks/$(cmd)
, it won’t split the words then. If you can figure it out so that the quoted output can be fed directly into pip install
please let me know.
The full docs are here: https://docs.fast.ai/install.html#custom-dependencies
This is totally new (a custom distutil command that I just invented), so feedback is welcome (more intuitive API, etc.)