ZauggGroup / DeePiCt

Pipeline for the automatic detection and segmentation of particles and cellular structures in 3D Cryo-ET data, based on deep learning (convolutional neural networks).
Apache License 2.0
30 stars 9 forks source link

Containerization support #12

Open DimitriosBellos opened 1 year ago

DimitriosBellos commented 1 year ago

This pull request contains 2 Dockerfile files to construct 2 Docker images. One that will work for the 2d_cnn scripts using Ubuntu 18.04 and CUDA 10.0 and another for the 3d_cnn, spectrum filter and addtional_scripts scripts using Ubuntu 20.04 and CUDA 11.6. The reason I am using separate images is because the 3d_cnn sripts were written recently (within 2022) with the most up to date pytorch version at the time being pytorch 1.12 (which is only available for CUDA 11.6, 11.3 and 10.2). To also accommodate the installation of pytorch from the recommended conda channel (-c pytorch as you can see here ) I properly ammended the environment.yml file in the 3dcnn directory. I also include some deploy*.sh files that help with the proper execution of Docker images.

For the Docker image regarding the 2d_cnn scripts, it can be build as such:

cd DeePicT
docker build . -f Dockerfile-2d_cnn -t deepict:v1.0.1-2d-cnn

and run like this ( has to be replaced appropriately):

docker run --gpus all -v <data_directory>:/mnt --workdir=/mnt -it --rm deepict:v1.0.1-2d-cnn

Within the container first run:

source activate snakemake-keras

Then you may use:

deepict2D_config <template_config_name>.yaml

To create a template config file named .yaml in the present working directory. And after modifying it you may run:

deepict2D <template_config_name>.yaml

Which is similar on doing bash 2d_cnn/deploy_local.sh <template_config_name>.yaml

For the Docker image regarding the 3d_cnn scripts, it can be build as such:

cd DeePicT
docker build . -f Dockerfile-3d_cnn -t deepict:v1.0.1-3d-cnn

and run like this ( has to be replaced appropriately):

docker run --gpus all -v <data_directory>:/mnt --workdir=/mnt -it --rm deepict:v1.0.1-3d-cnn

Within the container first run:

source activate 3d-unet

Then you may use:

deepict3D_config <template_config_name>.yaml

To create a template config file named .yaml in the present working directory. And after modifying it you may run:

deepict3D <template_config_name>.yaml

Which is similar on doing bash 3d_cnn/deploy_local.sh <template_config_name>.yaml