Tensorflow Error:AttributeError: 'module' object has no attribute 'LinearOperatorTriL'

现象:AttributeError: ‘module’ object has no attribute ‘LinearOperatorTriL’

原因:Tensorflow 版本问题

解决方法:

把  tril = tf.contrib.linalg.LinearOperatorTriL(diag_vals).to_dense() # (T_q, T_k)
换成 tril = tf.linalg.LinearOperatorLowerTriangular(diag_vals).to_dense() # (T_q, T_k)

参考: https://github.com/Kyubyong/transformer/issues/30


你可能感兴趣的:(深度学习)