0
votes

I have installed Tensorflow in anaconda on Windows 10, but I'm getting an error when importing some modules:

my_optimizer = tf.contrib.estimator.clip_gradients_by_norm(my_optimizer, 5.0)

AttributeError: module 'tensorflow.contrib' has no attribute 'estimator'

Screenshot

How can I solve this error?

2
Can you show what 'import' statements you've used? If you're getting this error after 'import tensorflow.contrib', that might point to an installation problem. - rwp
Which trensdsorflow Version are you using. ??? - Jai
I have latest version of tensorflo, and when I run 'import tensorflow.contrib', I do not get any error but when I run 'my_optimizer = tf.contrib.estimator.clip_gradients_by_norm(my_optimizer, 5.0)' I got error which i aready told you, and also I am getting error when i am running 'from tensorflow.python.data import Dataset' error "ModuleNotFoundError: No module named 'tensorflow.python.data'" - SiDdhartha

2 Answers

0
votes

Try importing tensorflow as tf.

0
votes

I know is a bit old topic but my solution was:

sudo pip install --upgrade tensorflow==1.12.0

Here is 1.12.0 but use the last stable update.

In other words, try to update your tensorflow installation and everything should be better.