Installation

DeepForest has Windows, Linux and OSX prebuilt wheels on pypi. We strongly recommend using a conda or virtualenv to create a clean installation container.

pip install DeepForest

For questions on conda-forge installation, please submit issues to the feedstock repo: https://github.com/conda-forge/deepforest-feedstock

Windows Installation

DeepForest itself is pure python and will work on all major operating systems. It can be difficult to install some of the geospatial dependencies on windows using pip. If you have trouble installing gdal, rasterio or fiona on windows see rasterio docs

Source Installation

DeepForest can alternatively be installed from source using the github repository. The python package dependencies are managed by conda.

git clone https://github.com/weecology/DeepForest.git
cd DeepForest
conda env create --file=environment.yml
conda activate deepforest

GPU support

Pytorch can be run on GPUs to allow faster model training and prediction. Deepforest is a pytorch lightning module, as automatically distributes data to available GPUs. If using a release model with training, the module can be moved from CPU to GPU for prediction is the pytorch.to() method.

from deepforest import main
m = main.deepforest()
m.use_release()
print("Current device is {}".format(m.device))
m.to("cuda")
print("Current device is {}".format(m.device))
Current device is cuda:0

Distributed multi-gpu prediction outside of the training module is not yet implemented. We welcome pull requests for additional support.