TensorFlow(七) TensorFlow 勘误

来源:互联网 发布:linux服务器配置ipv6 编辑:程序博客网 时间:2024/05/22 10:30

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

def test():    sess = tf.Session()    v1 = tf.constant([1, 3, 5, 7, 9])    v2 = tf.constant([3, 4, 5, 6, 7])    with sess.as_default():        print(tf.select(tf.greater(v1, v2), v1, v2).eval())
运行 TensorFlow 版本环境为 1.3.0 , 运行会出现如上 no attribute 错误

修改方法 : 将 select 方法修改为 where 方法即可


2. 

原创粉丝点击