Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error running code #30

Open
ashishkr23 opened this issue Apr 27, 2018 · 6 comments
Open

error running code #30

ashishkr23 opened this issue Apr 27, 2018 · 6 comments

Comments

@ashishkr23
Copy link

ashishkr23 commented Apr 27, 2018

i followed all the steps but get the following error.

File "/home/ashishkr/projects/python/transformer/modules.py", line 227, in multihead_attention
tril = tf.contrib.linalg.LinearOperatorTriL(diag_vals).to_dense() # (T_q, T_k)
AttributeError: 'module' object has no attribute 'LinearOperatorTriL'

tf version 1.5.0 and 1.7.0
would be great if you can point out a solution

@ashishkr23
Copy link
Author

function has been changed to LinearOperatorLowerTriangular

@CloudApiStudy
Copy link

Thank you! I have the same problem and it works for me!

@xu-song
Copy link
Contributor

xu-song commented Jun 9, 2018

-  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)

@aforever
Copy link

function has been changed to LinearOperatorLowerTriangular

Hi, bro, how do you deal with such VERSION problems? I think google should add some instructions in the history versions.

@aishwaryadhage
Copy link

Hello I am getting a similar error.
File "/Users/aishwarya/Desktop/transformers/modules.py", line 227, in multihead_attention
tril = tf.contrib.linalg.LinearOperatorLowerTriangular(diag_vals).to_dense() # (T_q, T_k)
AttributeError: module 'tensorflow.contrib' has no attribute 'linalg'

My tf version is - 1.13.0-dev20181108
Any guidance will be really helpful.

@wolfade
Copy link

wolfade commented Jan 9, 2019

Hello I am getting a similar error.
File "/Users/aishwarya/Desktop/transformers/modules.py", line 227, in multihead_attention
tril = tf.contrib.linalg.LinearOperatorLowerTriangular(diag_vals).to_dense() # (T_q, T_k)
AttributeError: module 'tensorflow.contrib' has no attribute 'linalg'

My tf version is - 1.13.0-dev20181108
Any guidance will be really helpful.

I think you should exclude 'contrib' when you use this function.
In my case, it works well (tf version 1.12.0)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants