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

initial versions

# Change the configuration here.
# Include your useid/name as part of IMAGENAME to avoid conflicts
IMAGENAME = keras-retinanet
CONFIG = tensorflow
COMMAND = bash
# -v $(PWD)/../imagesim-docker:/data:ro -v $(PWD):/project
# For jupyter:
# PORT = -p 8888:8888
# Sometimes necessary for networking to work:
# NETWORK = --network host
GPU = 0
# 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
# Starts and interactive shell by default (COMMAND = bash)
default: .docker
# $(WEIGHTS): src/
# $(RUNCMD) python3 src/
train: .docker $(WEIGHTS)
$(RUNCMD) python3 keras-retinanet/keras_retinanet/bin/
test: .docker src/ $(WEIGHTS)
$(RUNCMD) python3 src/
# 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
RUN cd keras-retinanet && python 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 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