TensorFlow(七) TensorFlow 勘误

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. 

猜你喜欢

转载自blog.csdn.net/jiangmengya1/article/details/78267843