您的位置:首页 > 其它

使用TensorFlow1.0及以上版本的问题

2018-01-26 13:16 471 查看
转自 http://blog.csdn.net/caicai_zju/article/details/70477929

BUG 1. AttributeError: ‘module’ object has no attribute ‘mul’
# 解决方案:
用tf.multiply替代tf.mul
1
2

BUG 2. AttributeError: ‘module’ object has no attribute ‘sub’ 

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

BUG 3. AttributeError: ‘module’ object has no attribute ‘neg’
# 解决方案:
用tf.negative替代tf.neg
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_))
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐