我正在尝试创建由以下函数创建的张量的检查点,但我的时间很艰难(Tensorflow 1.x)。泡菜不起作用。
def _create_discriminator(self, x, train=True, reuse=False, name="discriminator"):
with tf.variable_scope(name) as scope:
if reuse:
scope.reuse_variables()
h = x
for i in range(self.num_conv_layers):
h = lrelu(batch_norm(conv2d(h, self.num_dis_feature_maps * (2 ** i),
stddev=0.02, name="d_h{}_conv".format(i)),
is_training=train,
scope="d_bn{}".format(i)))
dim = h.get_shape()[1:].num_elements()
h = tf.reshape(h, [-1, dim])
d_bin_logits = linear(h, 1, scope='d_bin_logits')
d_mul_logits = linear(h, self.num_gens, scope='d_mul_logits')
return d_bin_logits, d_mul_logits