报错:AttributeError: module 'tensorflow' has no attribute 'truncated_normal'
报错代码:
initial = tf.truncated_normal(shape, stddev=0.1,dtype=tf.float32)
原因:版本问题
解决办法:
initial = tf.compat.v1.truncated_normal(shape, stddev=0.1,dtype=tf.float32)
报错:AttributeError: module 'tensorflow' has no attribute 'truncated_normal'
报错代码:
initial = tf.truncated_normal(shape, stddev=0.1,dtype=tf.float32)
原因:版本问题
解决办法:
initial = tf.compat.v1.truncated_normal(shape, stddev=0.1,dtype=tf.float32)