Single Shot MultiBox Detector with Pytorch

Step 1:
Spin GPU VM on Azure - I chose NC6

Step 2: 
ssh to VM - I used Hyper which works perfectly on Windows and Linux

Step 3:
$ sudo docker login

Step 4:
sudo  docker pull azadehkhojandi/gpu-minimal-notebook

Step 5:
If you have nvidia-docker 1.0 installed: we need to remove it and all existing GPU containers
$ sudo docker volume ls -q -f driver=nvidia-docker | xargs -r -I{} -n1 docker ps -q -a -f volume={} | xargs -r docker rm -f

$ sudo apt-get purge -y nvidia-docker

Add the package repositories
curl -s -L | sudo apt-key add -
distribution=$(. /etc/os-release;echo $ID$VERSION_ID)
curl -s -L$distribution/nvidia-docker.list | sudo tee /etc/apt/sources.list.d/nvidia-docker.list
$ sudo apt-get update

Install nvidia-docker2 and reload the Docker daemon configuration
$ sudo apt-get install -y nvidia-docker2

$ sudo pkill -SIGHUP dockerd

Test nvidia-smi with the latest official CUDA image
$ sudo docker run --runtime=nvidia --rm nvidia/cuda:9.0-base nvidia-smi

Step 6:
Add an inbound port on the Azure portal

Step 7:
Set up your workspace folder - ideally on the attached disk

$ sudo mkdir myworkspace

$ cd myworkspace/

$ sudo chmod -R 777 $PWD

Step 8:
close exit the container by pressing ctrl + c

clone the repo inside the myworkspace folder

$ git clone


Step 9:
under myworkspace create another folder named data

$ sudo mkdir data

download the datasets

$ sh ssd.pytorch/data/scripts/ data
$ sh ssd.pytorch/data/scripts/ data
$ sh ssd.pytorch/data/scripts/ data

Step 10:
Download vgg weights under  ssd.pytorch/weights

$ cd  ssd.pytorch
$ mkdir weights
$ cd weights
$ wget
$ wget
$ wget

Step 11:
now we can run our container

$  sudo nvidia-docker run --rm -p 8888:8888 -v "$PWD/ssd.pytorch":/home/jovyan/work  -v "$PWD/data":/home/jovyan/data azadehkhojandi/gpu-minimal-notebook

browse  http://{yourvmpublicip}:8888/?token=tokenprovidedafterrunningcontainer

open notebooks/work/demo/demo.ipynb 

first, you need to install missing dependencies inside the container,

run the first three blocks, then reset your kernel and run other blocks and continue running the rest of blocks