Here we present two ways how to install the packages.
- A) requires GDAL to be installed on the system first.
- B) GDAL is installed with mamba/conda in the environment.
- Install GDAL. For Ubuntu follow e.g. these instructions.
- Create a new virtual environment called
gchm
by running:python -m venv $HOME/venvs/gchm
- Activate the environment:
source $HOME/venvs/gchm/bin/activate
. (Check that python points to the new environment withwhich python3
.) - Install pytorch by following the instructions on pytorch.org that match your versions. Run e.g.
python3 -m pip install torch torchvision torchaudio
- Install the GDAL python API matching the installed GDAL version:
python3 -m pip install GDAL==3.5.3
- Install all other required packages:
python3 -m pip install -r requirements.txt
- Install this project as an editable package called
gchm
. Make sure you are in the directory of the repository containing the filesetup.py
. Run:python3 -m pip install -e .
(Note the dot.
at the end.)
- Install mambaforge: https://github.com/conda-forge/miniforge#mambaforge
- Create a new environment called
gchm
with pytorch (or follow the instructions on pytorch.org):mamba create -n gchm python=3.10.9 pytorch torchvision torchaudio cudatoolkit=11.8 -c pytorch -c nvidia
- Activate the environment:
mamba activate gchm
. (Check that python points to the new environment: E.g.which python
should print something like:~/mambaforge/envs/gchm/bin/python
) - Install gdal:
mamba install -c conda-forge gdal=3.6.2
- Install pytables:
mamba install -c anaconda pytables=3.7.0
- Install all other required packages from conda-forge using the
environment.yml
file. Change directory to the repository and run:mamba env update -f environment.yml
- Install this project as an editable package called
gchm
. Make sure you are in the directory of the repository containing the filesetup.py
. Run:pip install -e .
(Note the dot.
at the end.)
Optional. Only needed to run the training code (Not needed for deployment).
Create a file called ~/.config_wandb
containing your weights and biases API key:
export WANDB_API_KEY=YOUR_API_KEY
Optional. This is only needed to download Sentinel-2 images from AWS on the fly using gchm/deploy.py
.
Note that there are costs per GB downloaded!
Create a file ~/.aws_configs
containing your AWS credentials as environment variables.
export AWS_ACCESS_KEY_ID=PUT_YOUR_KEY_ID_HERE
export AWS_SECRET_ACCESS_KEY=PUT_YOUR_SECRET_ACCESS_KEY_HERE
export AWS_REQUEST_PAYER=requester
To create an AWS account go to: https://aws.amazon.com/console/