Commit de13e372 authored by Ketil Malde's avatar Ketil Malde
Browse files

initial versions

parents
# Change the configuration here.
# Include your useid/name as part of IMAGENAME to avoid conflicts
IMAGENAME = keras-retinanet
CONFIG = tensorflow
COMMAND = bash
DISKS =
# -v $(PWD)/../imagesim-docker:/data:ro -v $(PWD):/project
PORT =
# For jupyter:
# PORT = -p 8888:8888
NETWORK =
# Sometimes necessary for networking to work:
# NETWORK = --network host
GPU = 0
RUNTIME =
# RUNTIME = --gpus device=$(GPU)
# No need to change anything below this line
USERID = $(shell id -u)
GROUPID = $(shell id -g)
USERNAME = $(shell whoami)
# Allows you to use sshfs to mount disks
SSHFSOPTIONS = --cap-add SYS_ADMIN --device /dev/fuse
USERCONFIG = --build-arg user=$(USERNAME) --build-arg uid=$(USERID) --build-arg gid=$(GROUPID)
.PHONY: .docker test train
.docker: docker/Dockerfile-$(CONFIG)
docker build $(USERCONFIG) $(NETWORK) -t $(USERNAME)-$(IMAGENAME) -f docker/Dockerfile-$(CONFIG) docker
# WEIGHTS = mask_rcnn_coco.h5
# Using -it for interactive use
RUNCMD=docker run $(RUNTIME) $(NETWORK) --rm --user $(USERID):$(GROUPID) $(PORT) $(SSHFSOPTIONS) $(DISKS) -it $(USERNAME)-$(IMAGENAME)
# Starts and interactive shell by default (COMMAND = bash)
default: .docker
$(RUNCMD) $(COMMAND)
# $(WEIGHTS): src/download_weights.py
# $(RUNCMD) python3 src/download_weights.py
train: .docker $(WEIGHTS)
$(RUNCMD) python3 keras-retinanet/keras_retinanet/bin/train.py
test: .docker src/test.py $(WEIGHTS)
$(RUNCMD) python3 src/test.py
# Use an official Python runtime as a parent image
FROM tensorflow/tensorflow:1.15.2-gpu-py3
# Set the working directory to
WORKDIR /project
# User configuration - override with --build-arg
ARG user=myuser
ARG group=mygroup
ARG uid=1000
ARG gid=1000
# Some debs want to interact, even with apt-get install -y, this fixes it
ENV DEBIAN_FRONTEND=noninteractive
ENV HOME=/project
# Install any needed packages from apt
RUN apt-get update && apt-get install -y sudo python3 python3-pip git
# Configure user
RUN groupadd -f -g $gid $user
RUN useradd -u $uid -g $gid $user
RUN usermod -a -G sudo $user
RUN passwd -d $user
# Alternative here, but let's run in place (below)
# RUN pip3 install . --user
RUN git clone https://git.imr.no/a5515/keras-retinanet.git
RUN cd keras-retinanet && python setup.py build_ext --inplace
RUN apt-get install -y libsm6 libxrender1
# keras 2.4.0 requires tensorflow 2.2, but Matterport Mask R-CNN doesn't support it
RUN pip3 install --trusted-host pypi.python.org numpy scipy Pillow cython matplotlib scikit-image keras==2.3.1 opencv-python h5py imgaug IPython progressbar2
# Run when the container launches
CMD "bash"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment