Skip to content

aspotton/ml-base

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ml-base

Base image for machine learning projects using Miniconda and Tensorflow. The idea is you can clone this repo and use it to start a new ML project, just adjust environment.yml accordingly.

Currently uses: CUDA 10.0 for use with NVIDIA binary driver

Supported Python Versions Project Status: WIP – Initial development is in progress, but there has not yet been a stable, usable release suitable for the public. License

How Does It Work

You need to have the latest NVIDIA binary driver installed on the host system. Docker will pass privileges to the container so that it can access the video card when needed.

Usage

Install the latest NVIDIA driver

Ubuntu

sudo add-apt-repository ppa:graphics-drivers/ppa
sudo apt update
sudo ubuntu-drivers autoinstall

You can also see a list of alternative drivers

ubuntu-drivers devices

Building the Image

docker build -t mlbase:cuda10 .

Using the Image

Change to the project code directory. This will be mapped to the /code directory inside the container.

If this is the first time running you'll need to create and setup the container by running:

docker run -dt --name projectname --runtime=nvidia -e UID=$(id -u) -e GID=$(id -g) -e USER=$(whoami) -e DISPLAY="$DISPLAY" -v /tmp/.X11-unix:/tmp/.X11-unix -v $(pwd):/code -p 8000:8000 mlbase:cuda10 /bin/bash -l

It can then be started with

docker start projectname

To get a shell in the running container

docker exec -it -u $(whoami) -e DISPLAY="$DISPLAY" projectname /bin/bash -l

At first run, setup the ml conda environment

sudo /opt/conda/bin/conda env update --file /code/environment.yml
source activate ml

Jupyter Notebook

To use, append this to the docker run command:

"jupyter notebook --ip=0.0.0.0 --port=8888"

About

Base image for machine learning projects

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published