一、训练
1、《神奈川冲浪里》风格
风格如图
2、配置yml文件
style_image: img/wave.jpg # targeted style image指定原始风格图像
##naming、model_path 两个量定义了最终的checkpoint 和监控信息。events文件会被保存在models/wave文件夹下
naming: "wave" # the name of this model一般和图像名字保持一致. Determine the path to save checkpoint and events file.
model_path: models # root path根目录 to save checkpoint and events file. The final path would be <model_path>/<naming>
## Weight of the loss各个损失的权重
content_weight: 1.0 # weight for content features loss内容损失权重
style_weight: 220.0 # weight for style features loss风格损失权重
tv_weight: 0.0 # weight for total variation loss,(1)在本项目中,发现设定它的权重为0也不影响收敛
## The size, the iter number to run 训练原始图片大小、一次batch的样本数、跑的epoch运行次数
image_size: 256
batch_size: 4
epoch: 2
## Loss Network损失网络
loss_model: "vgg_16"
content_layers: # use these layers for content loss使用conv3_3定义内容损失
- "vgg_16/conv3/conv3_3"
style_layers: # use these layers for style loss使用conv1_2、conv2_2、conv3_3、conv4_3定义风格损失
- "vgg_16/conv1/conv1_2"
- "vgg_16/conv2/conv2_2"
- "vgg_16/conv3/conv3_3"
- "vgg_16/conv4/conv4_3"
checkpoint_exclude_scopes: "vgg_16/fc" # we only use the convolution layers, so ignore fc layers.只用到卷积层所以不需要fc层
loss_model_file: "pretrained/vgg_16.ckpt" # the path to the checkpoint预训练模型对应的位置
二、TensorBoard中监控训练情况
————————————————
版权声明:本文为CSDN博主「一个处女座的程序猿」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/qq_41185868/article/details/82940785