“22cb62db862536a67162c56b7374367c643d033e”上不存在“develop/doc/howto/usage/cmd_parameter/arguments_en.html”
未验证 提交 82a2acbc 编写于 作者: L lvmengsi 提交者: GitHub

fix bug of gan in python3 (#2363)

fix bug of gan in python3
上级 c78016e7
......@@ -162,7 +162,7 @@ def build_generator_resnet_blocks(inputgen,
name=name + "_c3",
norm=norm_type,
activation_fn='relu')
for i in xrange(n_gen_res):
for i in range(n_gen_res):
conv_name = name + "_r{}".format(i + 1)
res_output = build_resnet_block(
res_input,
......@@ -375,7 +375,7 @@ def build_discriminator_Nlayers(inputdisc,
relufactor=0.2,
use_bias=True)
d_dims = d_base_dims
for i in xrange(d_nlayers - 1):
for i in range(d_nlayers - 1):
conv_name = name + "_c{}".format(i + 2)
d_dims *= 2
dis_output = conv2d(
......
......@@ -162,7 +162,7 @@ def build_generator_resnet_blocks(inputgen,
name=name + "_c3",
norm=norm_type,
activation_fn='relu')
for i in xrange(n_gen_res):
for i in range(n_gen_res):
conv_name = name + "_r{}".format(i + 1)
res_output = build_resnet_block(
res_input,
......@@ -494,7 +494,7 @@ def build_discriminator_Nlayers(inputdisc,
relufactor=0.2,
use_bias=True)
d_dims = d_base_dims
for i in xrange(d_nlayers - 1):
for i in range(d_nlayers - 1):
conv_name = name + "_c{}".format(i + 2)
d_dims *= 2
dis_output = conv2d(
......
python infer.py --init_model output/checkpoints/199/ --input data/cityscapes/testA/* --input_style A --model_net cyclegan --net_G resnet_6block --g_bash_dims 32
python infer.py --init_model output/checkpoints/199/ --input "data/cityscapes/testA/*" --input_style A --model_net cyclegan --net_G resnet_6block --g_bash_dims 32
python infer.py --init_model output/chechpoints/199/ --input data/cityscapes/testB/* --model_net Pix2pix --net_G unet_256
python infer.py --init_model output/chechpoints/199/ --input "data/cityscapes/testB/*" --model_net Pix2pix --net_G unet_256
......@@ -91,10 +91,10 @@ class GTrainer():
optimizer = fluid.optimizer.Adam(
learning_rate=fluid.layers.piecewise_decay(
boundaries=[99 * step_per_epoch] +
[x * step_per_epoch for x in xrange(100, cfg.epoch - 1)],
[x * step_per_epoch for x in range(100, cfg.epoch - 1)],
values=[lr] + [
lr * (1.0 - (x - 99.0) / 101.0)
for x in xrange(100, cfg.epoch)
for x in range(100, cfg.epoch)
]),
beta1=0.5,
beta2=0.999,
......@@ -125,10 +125,10 @@ class DATrainer():
optimizer = fluid.optimizer.Adam(
learning_rate=fluid.layers.piecewise_decay(
boundaries=[99 * step_per_epoch] +
[x * step_per_epoch for x in xrange(100, cfg.epoch - 1)],
[x * step_per_epoch for x in range(100, cfg.epoch - 1)],
values=[lr] + [
lr * (1.0 - (x - 99.0) / 101.0)
for x in xrange(100, cfg.epoch)
for x in range(100, cfg.epoch)
]),
beta1=0.5,
beta2=0.999,
......@@ -158,10 +158,10 @@ class DBTrainer():
optimizer = fluid.optimizer.Adam(
learning_rate=fluid.layers.piecewise_decay(
boundaries=[99 * step_per_epoch] +
[x * step_per_epoch for x in xrange(100, cfg.epoch - 1)],
[x * step_per_epoch for x in range(100, cfg.epoch - 1)],
values=[lr] + [
lr * (1.0 - (x - 99.0) / 101.0)
for x in xrange(100, cfg.epoch)
for x in range(100, cfg.epoch)
]),
beta1=0.5,
beta2=0.999,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册