Getting started: download and installation

Downloading dwi_ml

To use the DWI_ML toolkit you will need to clone the repository and install the required dependencies:

git clone https://github.com/scil-vital/dwi_ml.git

Installing dependencies

We support python 3.10. (python3.10-distutils and python3.10-dev must also be installed). Code seems to work on python 3.8, but we do not support it.

The toolkit relies on Scilpy and on a number of other packages available through the Python Package Index (PyPI) (i.e. you can use pip).

We strongly recommend working in a virtual environment to install all dependencies related to DWI_ML.

  • To install Scilpy, clone the repository locally and follow the instructions in the README files in each of the repositories.

  • To install the dependencies of DWI_ML, do:

    pip install -r requirements.txt
    
  • The toolkit heavily relies on deep learning methods. As such, a GPU device will be instantiated whenever one is available. DWI_ML uses PyTorch as its deep learning back end. Thus, in order to use DWI_ML deep learning methods you will need to take a few additional steps.

    1. Cuda:

    • Verify that your computer has the required capabilities in the Pre-installation Actions section at cuda/cuda-installation-guide (sections 2.1 - 2.4). To find your OS version and the available GPU, check the About menu in your computer settings.

    • Follow the download instructions at nvidia.com/cuda-downloads. Choose the environment that fits your system in the selector. You can choose deb(local) for the installer type.

    • Follow the installation instructions.

    1. PyTorch:

    • Install PyTorch. Use the selector under the Start locally section at pytorch.org/get-started to have the specific command line instructions to install PyTorch with CUDA capabilities on your system.

    • Perform the suggested verifications to make sure that both CUDA and PyTorch have been correctly installed.

Creating a Comet account

  • The toolkit uses comet_ml. It is a python library that creates an “Experiment” (ex, training a model with a given set of hyperparameters) which automatically creates many types of logs online. It requires user to set an API key in $HOME/.comet.config with contents:

    [comet]
    api_key=YOUR-API-KEY

Alternatively, you can add it as an environment variable. Add this to your $HOME/.bashrc file.

export COMET_API_KEY=YOUR-API-KEY

An API (application programming interface) is a code that gets passed in by applications, containing information to identify its user, for instance. To get an API key, see https://https://www.comet.com/docs/v2/guides/getting-started/quickstart/#get-an-api-key. Click on the key icon, copy value to the clipboard and save it in your file in $HOME.

Installing dwi_ml

If you want to install the toolkit on your machine or your virtual environment, as a user you should type:

python setup.py install

If you want to develop DWI_ML you should type:

python setup.py develop