Unverified Commit 7d2ac334 authored by peastman's avatar peastman Committed by GitHub
Browse files

Merge pull request #1662 from peastman/gan

Workaround for bug in TF 1.14
parents 2b709f7b a65fad8c
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -137,10 +137,11 @@ class GAN(KerasModel):
      # Create learnable weights for the generators and discriminators.

      gen_alpha = layers.Variable(np.ones((1, n_generators)), dtype=tf.float32)
      gen_weights = Softmax()(gen_alpha([]))
      # We pass an input to the Variable layer to work around a bug in TF 1.14.
      gen_weights = Softmax()(gen_alpha([self.noise_input]))
      discrim_alpha = layers.Variable(
          np.ones((1, n_discriminators)), dtype=tf.float32)
      discrim_weights = Softmax()(discrim_alpha([]))
      discrim_weights = Softmax()(discrim_alpha([self.noise_input]))

      # Compute the weighted errors