tensorflow1.0后有AttributeError: ‘module’ object has no attribute 'xx'

来源:互联网 发布:淘宝网灯具城 编辑:程序博客网 时间:2024/06/06 06:38

BUG 1. AttributeError: ‘module’ object has no attribute ‘mul’

# 解决方案:用tf.multiply替代tf.mul
  • 1
  • 2
  • 1
  • 2

BUG 2. AttributeError: ‘module’ object has no attribute ‘sub’
解决方案:用tf.subtract替代tf.sub

# 解决方案:用tf.subtract替代tf.sub
  • 1
  • 2
  • 1
  • 2

BUG 3. AttributeError: ‘module’ object has no attribute ‘neg’

# 解决方案:用tf.negative替代tf.neg
  • 1
  • 2
  • 1
  • 2

BUG 4. ValueError: Only call sigmoid_cross_entropy_with_logits with named arguments (labels=…, logits=…, …)

# 解决方案:将tf.nn.sigmoid_cross_entropy_with_logits(self.D2_logits_, tf.ones_like(self.D2_) * 0.9))修改为tf.nn.sigmoid_cross_entropy_with_logits(labels=tf.ones_like(self.D2_) * 0.9, logits=self.D2_logits_))
阅读全文
0 0
原创粉丝点击