Skip to content

Commit

Permalink
Merge pull request #37 from MortenTabaka/Move-installation-with-Docke…
Browse files Browse the repository at this point in the history
…r-to-separate-file

Move docker and conda installation instructions to separate files
  • Loading branch information
MortenTabaka committed Sep 17, 2023
2 parents 3db6c6c + 4213790 commit e04116f
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 69 deletions.
67 changes: 67 additions & 0 deletions INSTALLATION-DOCKER.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
To use the dockerized version of Tensorflow,
first follow the official Nvidia installation guide: https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/install-guide.html#docker

## DockerHub Image for Linux
The ready-to-use image is accessible on Docker Hub.

### Pull the image
```
docker pull mortentabaka/landcover_semantic_segmentation_with_deeplabv3plus:latest
```
### Run the image in interactive mode
```
docker run --gpus all -it -p 8888:8888 mortentabaka/landcover_semantic_segmentation_with_deeplabv3plus:latest
```
### Run the image and create files locally
```
export PROJECT_PATH_LOCALLY="/path/to/local/code/directory" &&
git clone https://github.com/MortenTabaka/Semantic-segmentation-of-LandCover.ai-dataset.git "$PROJECT_PATH_LOCALLY" &&
docker run --gpus all -it -p 8888:8888 -v $PROJECT_PATH_LOCALLY:/app/ mortentabaka/landcover_semantic_segmentation_with_deeplabv3plus:latest
```

## Dockerfile - Tensorflow GPU
Clone the repository:
```
git clone git@github.com:MortenTabaka/Semantic-segmentation-of-LandCover.ai-dataset.git && cd Semantic-segmentation-of-LandCover.ai-dataset/
```

Build the docker image with the project's [Dockerfile](https://github.com/MortenTabaka/Semantic-segmentation-of-LandCover.ai-dataset/blob/main/Dockerfile):
```
docker build -t landcover_semantic_segmentation .
```
An official image was used as a base: https://hub.docker.com/layers/tensorflow/tensorflow/2.5.1-gpu-jupyter/images/sha256-5cdcd4446fc110817e5f6c5784eba6254258632036b426b9f194087e200f8a96?context=explore

Run the Jupyter Notebook with:
```
docker run --gpus all -it --rm -p 8888:8888 -v $(pwd):/app landcover_semantic_segmentation
```

## Dockerfile - Tensorflow CPU (not tested)
Clone the repository
```
git clone git@github.com:MortenTabaka/Semantic-segmentation-of-LandCover.ai-dataset.git && cd Semantic-segmentation-of-LandCover.ai-dataset/
```

In [Dockerfile](https://github.com/MortenTabaka/Semantic-segmentation-of-LandCover.ai-dataset/blob/main/Dockerfile)
change tensorflow image name to `tensorflow/tensorflow:2.5.1-jupyter`.

Build a image.
```
docker build -t landcover_semantic_segmentation .
```

To run the image, do not use flag `--gpus all`:

```
docker run -it --rm -p 8888:8888 -v $(pwd):/app landcover_semantic_segmentation
```

### If port is already in use

If port `8888` is already in use, then change its value, e.g. `-p 5555:8888`.
Remember to manually replace port in a link to the chosen value:

Would be: `http://127.0.0.1:8888/?token=...`

Should be: `http://127.0.0.1:5555/?token=...`
73 changes: 4 additions & 69 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,76 +51,11 @@ To facilitate analysis, the image is split into tiles, and predictions are made
# Installation
There are two ways to run this project: installing the environment via Anaconda or running a Docker container (recommended).

To use the dockerized version of Tensorflow,
follow the official Nvidia installation guide: https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/install-guide.html#docker
## Docker
[Installation guide - Docker](https://github.com/MortenTabaka/Semantic-segmentation-of-LandCover.ai-dataset/blob/main/INSTALLATION-DOCKER.md)

## DockerHub Image for Linux
The ready-to-use image is accessible on Docker Hub.

### Pull the image
```
docker pull mortentabaka/landcover_semantic_segmentation_with_deeplabv3plus:latest
```
### Run the image in interactive mode
```
docker run --gpus all -it -p 8888:8888 mortentabaka/landcover_semantic_segmentation_with_deeplabv3plus:latest
```
### Run the image and create files locally
```
export PROJECT_PATH_LOCALLY="/path/to/local/code/directory" &&
git clone https://github.com/MortenTabaka/Semantic-segmentation-of-LandCover.ai-dataset.git "$PROJECT_PATH_LOCALLY" &&
docker run --gpus all -it -p 8888:8888 -v $PROJECT_PATH_LOCALLY:/app/ mortentabaka/landcover_semantic_segmentation_with_deeplabv3plus:latest
```

## Dockerfile - Tensorflow GPU
Clone the repository:
```
git clone git@github.com:MortenTabaka/Semantic-segmentation-of-LandCover.ai-dataset.git && cd Semantic-segmentation-of-LandCover.ai-dataset/
```

Build the docker image with the project's [Dockerfile](https://github.com/MortenTabaka/Semantic-segmentation-of-LandCover.ai-dataset/blob/main/Dockerfile):
```
docker build -t landcover_semantic_segmentation .
```
An official image was used as a base: https://hub.docker.com/layers/tensorflow/tensorflow/2.5.1-gpu-jupyter/images/sha256-5cdcd4446fc110817e5f6c5784eba6254258632036b426b9f194087e200f8a96?context=explore

Run the Jupyter Notebook with:
```
docker run --gpus all -it --rm -p 8888:8888 -v $(pwd):/app landcover_semantic_segmentation
```

## Dockerfile - Tensorflow CPU (not tested)
Clone the repository
```
git clone git@github.com:MortenTabaka/Semantic-segmentation-of-LandCover.ai-dataset.git && cd Semantic-segmentation-of-LandCover.ai-dataset/
```

In [Dockerfile](https://github.com/MortenTabaka/Semantic-segmentation-of-LandCover.ai-dataset/blob/main/Dockerfile)
change tensorflow image name to `tensorflow/tensorflow:2.5.1-jupyter`.

Build a image.
```
docker build -t landcover_semantic_segmentation .
```

To run the image, do not use flag `--gpus all`:

```
docker run -it --rm -p 8888:8888 -v $(pwd):/app landcover_semantic_segmentation
```

### If port is already in use

If port `8888` is already in use, then change its value, e.g. `-p 5555:8888`.
Remember to manually replace port in a link to the chosen value:

Would be: `http://127.0.0.1:8888/?token=...`

Should be: `http://127.0.0.1:5555/?token=...`

## Anaconda Enviornment (legacy)
[Installation guide - Legacy](https://github.com/MortenTabaka/Semantic-segmentation-of-LandCover.ai-dataset/blob/main/INSTALLATION.md)
## Anaconda Environment (legacy)
[Installation guide - Conda](https://github.com/MortenTabaka/Semantic-segmentation-of-LandCover.ai-dataset/blob/main/INSTALLATION-CONDA.md)

# Jupyter Notebooks

Expand Down

0 comments on commit e04116f

Please sign in to comment.