From 5443706232fc008b19dcd972124b77616eede96b Mon Sep 17 00:00:00 2001 From: Hubert Siejkowski Date: Fri, 8 Sep 2023 09:51:52 +0200 Subject: [PATCH 1/2] Add conda environment and installation --- README.md | 48 +++++++++++++++++++++++++++++++++++++----------- environment.yml | 22 ++++++++++++++++++++++ 2 files changed, 59 insertions(+), 11 deletions(-) create mode 100644 environment.yml diff --git a/README.md b/README.md index 4353ca7..10fce5b 100644 --- a/README.md +++ b/README.md @@ -15,17 +15,47 @@ This repo contains notebooks and scripts demonstrating how to: This code is based on the [pick-benchmark](https://github.com/seisbench/pick-benchmark), the repository accompanying the paper: [Which picker fits my data? A quantitative evaluation of deep learning based seismic pickers](https://doi.org/10.1029/2021JB023499) -### Before running +### Installation method 1 + +Please download and install [Mambaforge](https://github.com/conda-forge/miniforge#mambaforge) following the [official guide](https://github.com/conda-forge/miniforge#install). + +After successful installation and within the Mambaforge environment please run following commands: + +``` +git clone ssh://git@git.plgrid.pl:7999/eai/platform-demo-scripts.git + +cd platform-demo-scripts +mambaforge env create -f environment.yml +``` + +This will create a conda environment named `platform-demo-scripts` with all required packages installed. + +To run the notebooks and scripts from this repository it is necessary to activate the `platform-demo-scripts` environment by running: + +``` +conda activate platform-demo-scripts +``` + +### Installation method 2 Please [install Poetry](https://python-poetry.org/docs/#installation), a tool for dependency management and packaging in Python. Then we will use only Poetry for creating Python environment and installing dependencies. +Install all dependencies with poetry, run: + +``` +poetry install +``` + +To run the notebooks and scripts from this repository it is necessary to activate the poetry environment by running: + +``` +poetry shell +``` + ### Usage -1. Install all dependencies with poetry, run: - - `poetry install` -2. Prepare .env file with content: +1. Prepare .env file with content: ``` WANDB_HOST="https://epos-ai.grid.cyfronet.pl/" WANDB_API_KEY="your key" @@ -33,15 +63,11 @@ Then we will use only Poetry for creating Python environment and installing depe WANDB_PROJECT="training_seisbench_models_on_igf_data" BENCHMARK_DEFAULT_WORKER=2 -3. Transform data into seisbench format. (unofficial) +2. Transform data into seisbench format. (unofficial) * Download original data from the [drive](https://drive.google.com/drive/folders/1InVI9DLaD7gdzraM2jMzeIrtiBSu-UIK?usp=drive_link) * Run the notebook: `utils/Transforming mseeds to SeisBench dataset.ipynb` -4. Initialize poetry environment: - - `poetry shell` - -5. Run the pipeline script: +3. Run the pipeline script: `python pipeline.py` diff --git a/environment.yml b/environment.yml new file mode 100644 index 0000000..6d2b921 --- /dev/null +++ b/environment.yml @@ -0,0 +1,22 @@ +name: platform-demo-scripts +channels: + - pytorch + - nvidia +dependencies: + - python=3.10 + - pytorch=2.0.1 + - pytorch-cuda + - PyYAML=6.0 + - python-dotenv=1.0.0 + - pandas=2.0.3 + - obspy=1.4.0 + - wandb=0.15.4 + - torchmetrics=0.11.4 + - pytorch-lightning + - scikit-learn + - openpyxl + - jupyterlab + - notebook + - pip + - pip: + - seisbench==0.4.1 From 4b169cab5b9f8b277a44d905b52fdfb1f3d76550 Mon Sep 17 00:00:00 2001 From: Hubert Siejkowski Date: Wed, 20 Sep 2023 22:38:58 +0200 Subject: [PATCH 2/2] Add installation method for OSX --- README.md | 12 ++++++++++-- epos-ai-train-osx.yml | 21 +++++++++++++++++++++ environment.yml => epos-ai-train.yml | 2 +- 3 files changed, 32 insertions(+), 3 deletions(-) create mode 100644 epos-ai-train-osx.yml rename environment.yml => epos-ai-train.yml (92%) diff --git a/README.md b/README.md index 10fce5b..395341b 100644 --- a/README.md +++ b/README.md @@ -19,13 +19,21 @@ This code is based on the [pick-benchmark](https://github.com/seisbench/pick-ben Please download and install [Mambaforge](https://github.com/conda-forge/miniforge#mambaforge) following the [official guide](https://github.com/conda-forge/miniforge#install). -After successful installation and within the Mambaforge environment please run following commands: +After successful installation and within the Mambaforge environment please clone this repository: ``` git clone ssh://git@git.plgrid.pl:7999/eai/platform-demo-scripts.git +``` +and please run for Linux or Windows platforms: +``` cd platform-demo-scripts -mambaforge env create -f environment.yml +mambaforge env create -f epos-ai-train.yml +``` +or for OSX: +``` +cd platform-demo-scripts +mambaforge env create -f epos-ai-train-osx.yml ``` This will create a conda environment named `platform-demo-scripts` with all required packages installed. diff --git a/epos-ai-train-osx.yml b/epos-ai-train-osx.yml new file mode 100644 index 0000000..1502139 --- /dev/null +++ b/epos-ai-train-osx.yml @@ -0,0 +1,21 @@ +name: epos-ai-train +channels: + - pytorch + - nvidia +dependencies: + - python=3.10 + - pytorch=2.0.1 + - PyYAML=6.0 + - python-dotenv=1.0.0 + - pandas=2.0.3 + - obspy=1.4.0 + - wandb=0.15.4 + - torchmetrics=0.11.4 + - pytorch-lightning + - scikit-learn + - openpyxl + - jupyterlab + - notebook + - pip + - pip: + - seisbench==0.4.1 diff --git a/environment.yml b/epos-ai-train.yml similarity index 92% rename from environment.yml rename to epos-ai-train.yml index 6d2b921..0ecd808 100644 --- a/environment.yml +++ b/epos-ai-train.yml @@ -1,4 +1,4 @@ -name: platform-demo-scripts +name: epos-ai-train channels: - pytorch - nvidia