(WaterGAN)tf.summary.scalar->tf.compat.v1.summary.scalar

在运行WaterGAN的代码时:

 self.d_loss_sum = tf.summary.scalar("d_loss", self.d_loss) 

改为:

self.d_loss_sum = tf.compat.v1.summary.scalar("d_loss", self.d_loss)   

类似的:
1.tf.summary.scalar->tf.compat.v1.summary.scalar
2.tf.summary.FileWriter->tf.compat.v1.summary.FileWriter
3.tf.summary.merge ->tf.compat.v1.summary.merge
4.tf.global_variables_initializer ->tf.compat.v1.global_variables_initializer
5.tf.train.AdamOptimizer -> tf.compat.v1.train.AdamOptimizer
6. tf.train.Saver -> tf.compat.v1.train.Saver
7. tf.trainable_variables ->tf.compat.v1.trainable_variables
8. tf.summary.image -> tf.compat.v1.summary.image
9. tf.image.resize_images -> tf.image.resize
10. tf.variable_scope -> tf.compat.v1.variable_scope
11.tf.placeholder ->tf.compat.v1.placeholder
11. tf.random_normal ->tf.random.normal
12. tf.get_variable -> tf.compat.v1.get_variable
13. tf.summary.histogram -> tf.compat.v1.summary.histogram

你可能感兴趣的:(python)