Contents
  1. 1. Environment
  2. 2. Install TensorFlow ROCm
  3. 3. Install libs for neural style
  4. 4. Result
  5. 5. Reference

Run an example of neural style by TensorFlow powered by ROCm.

Environment

  • Ubuntu 18.04
  • tensorflow 1.12.0
  • ROCm 2.0.89

Install TensorFlow ROCm

Install libs for neural style

  • Get the neural repository

    1
    git clone https://github.com/anishathalye/neural-style.git
  • Install libs by requirement file except tensorflow-gpu

    1
    2
    3
    4
    5
    6
    7
    8
    9
    pip3 install -r requirements.txt

    cat requirements.txt

    numpy
    Pillow # provides PIL
    scipy
    tensorflow-gpu >= 1.0 # installs tensorflow with GPU support, should still work even without GPU
    # Not necessary for tensorflow-rocm
  • Download vgg 19 mat data

  • Run neural sytle

    1
    python3 ./neural_style.py --overwrite --network ~/vgg-19-mat/imagenet-vgg-verydeep-19.mat --content origin/night.jpeg --styles examples/1-style.jpg --output output/night.jpg

Result

  • Original picture about night
    Image

  • Learn this picture’s style
    Image

  • Apply to original night and become a new night picture with above style
    Image

Reference

Contents
  1. 1. Environment
  2. 2. Install TensorFlow ROCm
  3. 3. Install libs for neural style
  4. 4. Result
  5. 5. Reference