深度学习初体会——fast-style-transfer

报了udacity的深度学习纳米学位课,虽然学费对我来说不少,但是想以后为自己就业多拓宽的路子还是咬牙分期付款。这也是第一次花这么多钱网络学习,希望能有所收获,更希望将来就业能多点机会。

这篇主要是第一次体会下深度学习。没有什么技术含量,只不过是记录一下过程罢了。

fast-style-transfer就是模仿名画的风格,把自己的照片转化成同样的风格。GitHub

1.Git clone

2. Anaconda

using Anaconda to manage packages and environments for use with Python.With Anaconda, it’s simple to install the packages you’ll often use in data science work. You’ll also use it to create virtual environments that make working on multiple projects much less mind-twisting.
Anaconda is actually a distribution of software that comes with conda, Python, and over 150 scientific packages and their dependencies.

Anaconda实际上是一个配有conda,Python和超过150个科学包及其依赖的软件分发。
conda是一个包和环境管理器。
Anaconda附带了Python中最常见的数据科学包。
Miniconda是Anaconda的简化版,只包括conda和Python。 可以根据需要安装任何conda可用的包。https://conda.io/miniconda.html

Conda包管理:

Package managers are used to install libraries and other software on your computer. You’re probably already familiar with pip, it’s the default package manager for Python libraries. Conda is similar to pip except that the available packages are focused around data science while pip is for general use.

Conda环境管理:

It’s similar to virtualenv and pyenv, other popular environment managers.Environments allow you to separate and isolate the packages you are using for different projects.

3. 配置环境

For Windows, you’ll need to install TensorFlow 0.12.1, Python 3.5, Pillow 3.4.2, scipy 0.18.1, and numpy 1.11.2.

conda create -n style-transfer python=3.5
activate style-transfer
conda install -c conda-forge tensorflow=0.12.1
conda install scipy pillow

4. Transferring styles

首先下载已经训练好的checkpoint 文件。
By using this checkpoint file, we won’t need to train the model and can get straight to applying it.

把下载的checkpoint 还有想处理的照片放到fast-style-transfer里。
在刚刚创建的环境中进入fast-style-transfer。然后输入命令:
python evaluate.py --checkpoint ./rain-princess.ckpt --in-path <path_to_input_file> --out-path ./output_image.jpg

发表评论

电子邮件地址不会被公开。 必填项已用*标注