aymericdamien / TensorFlow-Examples

TensorFlow Tutorial and Examples for Beginners (support TF v1 & v2)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

import tensorflow.contrib.eager as tfe error

missleepless opened this issue · comments

commented

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:

  • TensorFlow version: tensorflow GPU 2.0.0
  • Python version: 3.6.9
  • Installed using virtualenv? pip? conda?: pip
  • CUDA/cuDNN version:10.0/7.4
  • GPU model and memory: gtx1060/3G

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.

take it easy man, tf is fine without contrib

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'

I am having the same problem.

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