Public Repository

Last pushed: a year ago
Short Description
cuda enabled docker image of jcjohnson's neural-style
Full Description

This docker image bundles all prerequisites of jcjohnson's neural-style tool as well as the necessary cuda bindings and toolkits. It can be run on docker hosts with the nvidia drivers, nvidia-docker and nvidia-docker-plugin installed.

This image is currently work-in-progress and most likely not working fully yet when you're reading this.

To make full use of this image, you'll need a docker host that has the nvidia drivers installed.
I recommend following the instructions provided here to get a GPU instance deployed and to install the NVIDIA driver and the nvidia-docker package.

Right now the container isn't meant for non-interactive running. You'll have to "docker run" it manually like so:

Prepare the host, create folders to mount the volumes to, make sure the ubuntu user is in the docker and nvidia-docker group.

sudo mkdir -p /srv/neural-style/{images,outputs}
sudo chown -R ubuntu /srv/neural-style/
sudo usermod -G docker,nvidia-docker -a ubuntu

Place some content- and style-pictures into /srv/nerual-style/images.

Then go into the container...

nvidia-docker \
run -it \
-v /srv/neural-style/images:/root/neural-style/images \
-v /srv/neural-style/outputs:/root/neural-style/outputs \
--rm \
xplo/neural-style-cuda:latest \
/bin/bash

And then manually run like so:

INPUTFILE=input_image.jpg \
th neural_style.lua \
-gpu 0 -backend cudnn -cudnn_autotune \
-image_size 800
-output_image /root/neural-style/outputs/${INPUTFILE} \
-style_image /root/neural-style/images/stlye_image.jpg \
-content_image /root/neural-style/images/${INPUTFILE}

Note: At the time of writing this the amazon GPU instances provide 4GB of vram. You'll need to play with the settings and image sizes to avoid out of memory errors. Check jcjohnson's github repo for tips on this.

Docker Pull Command
Owner
xplo