TensorFlow升级到1.0版本的问题

xiaoxiao2021-02-28  86

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

# 解决方案: 用tf.multiply替代tf.mul 12 12

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

# 解决方案: 用tf.subtract替代tf.sub 12 12

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

# 解决方案: 用tf.negative替代tf.neg 12 12

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_logitBUG 4. ValueError: Only call sigmoid_cross_entropy_with_logits with named arguments (labels=…, logits=…, …) BUG5、AttributeError: 'module' object has no attribute 'global_variables_initializer'#解决方案:init = tf.global_variables_initializer() 替换

init = tf.initialize_all_variables()

转载请注明原文地址: https://www.6miu.com/read-57070.html

最新回复(0)