关于AttributeError: module 'tensorflow' has no attribute 'select'

在 Tensorflow 实战Google深度学习框架 第78页有关于tf.select的内容。

tf.select函数有3个参数。第一个为选择条件根据,当选择条件为True时,tf.select函数会选择第二个参数中的值,否则使用第三个参数中的值。

但是,在测试时有如下错误:

AttributeError: module 'tensorflow' has no attribute 'select'

原因:书中的TensorFlow版本是0.9.0,版本升级后会报错

解决方法:用tf.where替换tf.select

猜你喜欢

转载自blog.csdn.net/qq_27060423/article/details/84325435