Skip to content

Conversation

@matthieudelaro
Copy link

I added the file nut.yml, so that generating images in a docker image, on GPU, can be as easy as running the command nut run in the repo. This address issues/PR such as #151

Nut is a tool to run commands in a docker container, while supporting nvidia devices, volumes, etc. Here, nut.yml declares the following settings:

  • use docker image matthieudelaro/cuda-torch-plus
  • mount the current directory as /opt/style
  • mount nvidia GPUs in the container
  • run the neural network with 1000 iterations, computing a new image from style_image.jpg and content_image.jpg

Note that Docker supports GPUs on Linux only, and that Nut relies on nvidia-docker-plugin (details).

In case GPUs are not available, nut will display a warning message and run the neural network.

To run the neural network with a custom command, you can use --exec flag. For example:

nut --exec='th neural_style.lua -style_image examples/inputs/picasso_selfport1907.jpg -content_image examples/inputs/brad_pitt.jpg -output_image profile.png -model_file models/nin_imagenet_conv.caffemodel -proto_file models/train_val.prototxt -gpu 0 -backend clnn -num_iterations 1000 -seed 123 -content_layers relu0,relu3,relu7,relu12 -style_layers relu0,relu3,relu7,relu12 -content_weight 10 -style_weight 1000 -image_size 512 -optimizer adam'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant