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

AttributeError: module 'tensorflow.python.ops.gen_nn_ops' has no attribute '_relu_grad' #50

Closed
foreverYoungGitHub opened this issue Jun 5, 2018 · 5 comments

Comments

@foreverYoungGitHub
Copy link

Currently, I'm using tensorflow 1.8. When I run the example code with the deconv_visualization() function.

It returns error:

  File "/Yang/project/detection/code/tf18/third_party/tf_cnnvis/tf_cnnvis/tf_cnnvis.py", line 43, in _GuidedReluGrad
    return tf.where(0. < grad, gen_nn_ops._relu_grad(grad, op.outputs[0]), tf.zeros_like(grad))
AttributeError: module 'tensorflow.python.ops.gen_nn_ops' has no attribute '_relu_grad'

Do you have any idea about that. I'm really appreciate that!

@ggaziv
Copy link

ggaziv commented Jun 8, 2018

Getting similar error when running deconv_visualization.
Note that this exception occurs following exceptions that has to do with 'Xla':
tf_cnn_vis_Example2.ipynb

-> 2327           c_api.TF_OperationGetAttrValueProto(self._c_op, name, buf)
...
InvalidArgumentError: Operation 'Relu' has no attr named '_XlaCompile'.

Or:
tf_cnn_vis_Example1.ipynb

ValueError: Operation 'conv1' has no attr named '_XlaCompile'.

Using Anaconda 3.6 with tensorflow 1.8 on either CentOS 7.2 or macOS.

@tengerye
Copy link

tengerye commented Jun 13, 2018

Me, too. I have almost the same errors as @ggaziv . I work on Ubuntu 16.04.

@tengerye
Copy link

tengerye commented Jun 14, 2018

I successfully fix it. According to this post, change _relu_grad to relu_grad. @foreverYoungGitHub @ggaziv

@ggaziv
Copy link

ggaziv commented Jun 14, 2018

Works great ! Thanks @tengerye !

@BhagyeshVikani
Copy link
Member

Thanks @tengerye
Closing this now.

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

No branches or pull requests

4 participants