Installation

Use the package manager pip to install leap-ie.

pip install 'leap-ie[with-torch]'

If running in a Jupyter Notebook, shell commands can be run in a cell if prepended by a ! character. For example:

!pip install 'leap-ie[with-torch]'

For your chosen platform, leap-ie requires that the following version requirements are met:

Library
Version

torch

>=1.13.0

torchvision

>=0.14.0

timm

>=0.9.12

GPU Acceleration

GPU support for each library can be quite complex, especially with Tensorflow, and require aligning driver support with your library version, operating system, python version, system architecture etc.

For this reason, when installing leap-ie with optional extras, we do not automatically install libraries with GPU support out of the box. This is left for the user to set up for their own development environment.

For more information on how to set up GPU acceleration for your chosen library, see the associated docs:

PyTorch setup instructions

Mac Support

When running on a Mac, depending on the system architecture and operating system version, not all operations are supported by PyTorch on the mps backend. If this is the case, running leap-ie will fail with the error:

NotImplementedError: The operator 'aten::grid_sampler_2d_backward' is not currently implemented for the MPS device.

In order to fix this, incompatible operations can be run on the CPU as a fallback. To enable this mode set the environment variable PYTORCH_ENABLE_MPS_FALLBACK=1 before running leap-ie.