Quickstart

Requirement

This project comprises a set of commands to be run at a shell command prompt. Examples used here are for a bash shell in an Ubuntu GNU/Linux environment.

Note

The system can be used on your workstation or cluster.

Installation

Miniconda is suggested as the package manager for GDL. However, users are advised to switch to libmamba as conda’s default solver or to directly use mamba instead of conda if they are facing extended installation time or other issues. Additional problems are grouped in the Troubleshooting. If issues persist, users are encouraged to open a new issue for assistance.

Quickstart with conda

To execute scripts in this project, first create and activate your python environment with the following commands:

$ conda env create -f environment.yml
$ conda activate geo_deep_env

Note

Tested on Ubuntu 20.04, Windows 10 and WSL 2.

Change conda’s default solver for faster install (Optional)

$ conda install -n base conda-libmamba-solver
$ conda config --set solver libmamba

Troubleshooting

Import error:

$ *ImportError: /lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.29' not found*
$
$ # Export path to library or set it permenantly in your .bashrc file (example with conda) :
$ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$CONDA_PREFIX/lib/

Running GDL

This is an example of how to run GDL for a Segmentation task on the massachusetts buildings dataset (link). GDL is using Hydra library for more information see the Configuration section or go visit their documentation.

# Clone this github repo
(geo_deep_env) $ git clone https://github.com/NRCan/geo-deep-learning.git
(geo_deep_env) $ cd geo-deep-learning

# By default the task is set to segmentation
# Creating the patches from the raw data
(geo_deep_env) $ python GDL.py mode=tiling
# Training the neural network
(geo_deep_env) $ python GDL.py mode=train
# Inference on the data
(geo_deep_env) $ python GDL.py mode=inference

This example runs with a default configuration ./config/gdl_config_template.yaml. For further examples on configuration options or how to change the configuration go see the Configuration documentation.