由于tensordflow版本不一致可能会遇到下面的问题

https://github.com/yunjey/stargan/issues/109
遇到的一个问题

AttributeError: module ‘tensorflow’ has no attribute ‘Summary’ #9

链接给出的解决方案
In the recent version of TensorFlow, you should replace these lines:

summary = tf.Summary()
summary_value = summary.value.add()
summary_value.simple_value = value
summary_value.tag = graph_name

with:

with self.writer.as_default():

              tf.summary.scalar(graph_name, value)

              self.writer.flush()

Also, replace this line:

self.writer = tf.summary.FileWriter(log_dir)

with:

self.writer = tf.summary.create_file_writer(log_dir)

主要根据介绍修改上述即可。

  • 同时还遇到 TypeError: can’t convert CUDA tensor to numpy. Use Tensor.cpu() to copy the tensor to host memory fi 这个问题
    使用这个链接可以去解决问题
    添加链接描述
Logo

瓜分20万奖金 获得内推名额 丰厚实物奖励 易参与易上手

更多推荐