aymericdamien / TensorFlow-Examples

TensorFlow Tutorial and Examples for Beginners (support TF v1 & v2)
Other
43.3k stars 14.98k forks source link

import tensorflow.contrib.eager as tfe error #331

Open missleepless opened 4 years ago

missleepless commented 4 years ago

import tensorflow.contrib.eager as tfe

When I enter the above cmd in spyder3, I get the error of "ModuleNotFoundError: No module named 'tensorflow.contrib'". How can I solve this problem?

my System information:

xiao-fang123 commented 4 years ago

Me too. I searched online and learned that Tensorflow 2.0 removes 'tensorflow.contrib'. I don't know what else I can do except lower the version to Tensorflow 1.9.

xiangmingcai commented 4 years ago

take it easy man, tf is fine without contrib

SomePersonSomeWhereInTheWorld commented 3 years ago

Still getting this, perhaps the code should be updated for TF2?

Traceback (most recent call last):
  File "gradient_boosted_decision_tree.py", line 4, in <module>
    from tensorflow.contrib.boosted_trees.estimator_batch.estimator import GradientBoostedDecisionTreeClassifier
ModuleNotFoundError: No module named 'tensorflow.contrib'
LifeWorks commented 3 years ago

I am having the same problem.

LifeWorks commented 3 years ago

It says eager execution is enabled by default in TF 2.0. https://www.tensorflow.org/guide/eager

I guess you do not need to use the tfe anymore. Simply use the tf