Van Gogh Painting without a GPU: Ubuntu TensorFlow CPU Edition

\

\

Time: September 27, 2016 communication: TensorFlow actual combat communication Q group 472899334, if you have any questions, you can add this group to communicate together. To explore the principles behind the experiment, see Deep Learning Online Classes. \

\

\

One, foreword

On September 22, two colleagues from our development/marketing team used DL to learn van Gogh painting and installed CUDA 8.0. So, three days later on September 25, the tutorial Teach Van Gogh Painting From Start to finish using DL: GTX 1070 CUDa 8.0 TensorFlow GPU edition was released. But embarrassingly, many students don’t have a GTX 1070 or even a decent GPU.

For friends in Beijing, we can provide 1070 machine for you to experiment for free, but for more friends not in Beijing? In order for everyone to have a go, this CPU version of tensorFlow painting tutorial is published. As you can see, the build process is much simpler than the GPU version, but the disadvantage is that without the GPU, the calculation process is very laborious, about 1.5 hours for the I7-6700 (remember, if the GPU is properly built, the final calculation process only takes a few minutes).

But anyway, you didn’t do it because you said you didn’t have a GTX 1070, but now you have a CPU and you don’t have any hardware limitations, so why don’t you try it now? I hope more friends will play more interesting and fun experiments with us. \

\

\

Second, the installation

2.1. Install TensorFlow

Under Windows open a browser and enter: https://github.com/tensorflow/tensorflow

Download Linux CPU-only:Python2 as shown below, which will be used later in Step 3.1

\

2.2 installation neural – style

To enter in the address bar: https://github.com/anishathalye/neural-style

2.3 installation vgg19

To enter in the address bar: http://www.vlfeat.org/matconvnet/models/beta16/imagenet-vgg-verydeep-19.mat

A download dialog box pops up and you can download directly.

Put the downloaded file into the root directory of the neural style folder just now. Here is what I downloaded and copied the file.

\

PS: Remember to put all the above folders on your own USB flash drive for use in Ubuntu.

Install Ubuntu14.04

As with Ubuntu16.04, there are no CPU requirements for Ubuntu.

Download Ubuntu14.04:www.ubuntu.com/download/al… (Select 64-bit download)

UltraISO Floppy Disk Pass:

http://cn.ultraiso.net/xiazai.html (download link)

Next, installed directly: http://jingyan.baidu.com/article/eb9f7b6d8536a8869364e813.html

If you encounter problems, see the instructions for installing Ubuntu in the GPU version. ^ _ ^

\

\

Third, the experiment

3.1 Preparations

Open the Ubuntu command window and type: sudo -i

*** (your password)

Apt-get update (update all sources)

sudo apt-get install python-dev python-pip Python-scipy git

(The above command is necessary to download some tensorFlow libraries)

After entering the above command, insert the USB flash drive where you have just saved the downloaded file, and copy the file to the Download directory (other directories can also be used, familiar with Linux students to fix OK!).

Then type: CD /home/***(your user name)/Download/ Enter

Enter: PIP install tensorflow-0.10.0-cp27-none-linux_x86_64.whl // This file was downloaded in step 2.1

3.2 Start the Experiment

Enter CD neural style-neural style-master to go to the neural folder

Input: python neural_style.py –content ./examples/1-content.jpg –styles ./examples/1-style.jpg –output . / examples/JulyEdu. JPG the enter key

Then wait

Waiting for the school to wait for school to wait for the game of childhood \

\

Just wait (you know what we said earlier: it’s like having a baby). The computation can take an hour or two, three or four hours, or more (depending on the CPU configuration and image size).

But until the baby is born, you love it doubly.

\

\

Other tutorial

After the GPU and CPU tutorial of Van Gogh painting came out, many friends began to try to build and experiment, which felt like DL and experiment. Here are more tutorials for your reference, welcome to join us to experiment and play together!

  1. Van Gogh Painting for MAC + TensorFlow + CPU version (MAC CPU) \

  2. I5-4590 +VMware10+ubuntu16.04 Google tensorflow learn van gogh painting \

  3. Learn van Gogh painting with DL

  4. .

\

\

Afterword.

There’s nothing else to say, except that we’re going to do more experiments with you. Finally, explore the principles behind the experiments in this course: Deep Learning Online. July online development/marketing team Xiao Zhe, Li Wei, July, September 27, 2016.