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' has no attribute 'compat' #40422
Comments
Hi everyone |
What is the TF version you are trying to install? Also what steps did you follow? |
You can try uninstalling and re-installing TensorFlow. Also, check this link https://www.tensorflow.org/guide/migrate |
At first I uninstalled anaconda and all the NVIDIA programs I had before, to start over from scratch. |
I'm still getting the same error, even with the reinstallation of tensorflow using pip. |
You can follow the steps mentioned in the article below and check if it works. If it does not work, try pip install tensorflow==2.1. Found this here: #37525.
|
Same problem even with pip install tensorflow==2.1 ! Sorry, i already saw that issue |
Thank you for this article. I will follow these steps |
Please properly fill in issue template and use the proper Markdown formatting around errors and code blocks. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you. |
I have the same exact issue Here is my post I cant find a working solution for this issue |
Same issue for us. |
ISSUE FIXED for me Indeed the command "conda install tensorflow-gpu==2.1.0" installed version 2.2.0 of tensorflow-estimator. |
Automatically closing due to lack of recent activity. Please update the issue when new information becomes available, and we will reopen the issue. Thanks! |
After "conda install tensorflow-estimator==2.1.0", everything works fine for me too . |
AttributeError Traceback (most recent call last)
in
1 get_ipython().run_line_magic('matplotlib', 'inline')
2 import matplotlib.pyplot as plt
----> 3 import tensorflow as tf
4 import numpy as np
5 import pandas as pd
~\miniconda3\envs\tensorflow\lib\site-packages\tensorflow_init_.py in
99
100 # We still need all the names that are toplevel on tensorflow_core
--> 101 from tensorflow_core import *
102
103 # These should not be visible in the main tf module.
~\miniconda3\envs\tensorflow\lib\site-packages\tensorflow_core_init_.py in
44 from . _api.v2 import autograph
45 from . _api.v2 import bitwise
---> 46 from . _api.v2 import compat
47 from . _api.v2 import config
48 from . _api.v2 import data
~\miniconda3\envs\tensorflow\lib\site-packages\tensorflow_core_api\v2\compat_init_.py in
37 import sys as _sys
38
---> 39 from . import v1
40 from . import v2
41 from tensorflow.python.compat.compat import forward_compatibility_horizon
~\miniconda3\envs\tensorflow\lib\site-packages\tensorflow_core_api\v2\compat\v1_init_.py in
30 from . import autograph
31 from . import bitwise
---> 32 from . import compat
33 from . import config
34 from . import data
~\miniconda3\envs\tensorflow\lib\site-packages\tensorflow_core_api\v2\compat\v1\compat_init_.py in
37 import sys as _sys
38
---> 39 from . import v1
40 from . import v2
41 from tensorflow.python.compat.compat import forward_compatibility_horizon
~\miniconda3\envs\tensorflow\lib\site-packages\tensorflow_core_api\v2\compat\v1\compat\v1_init_.py in
27
28 from . import compat
---> 29 from tensorflow._api.v2.compat.v1 import app
30 from tensorflow._api.v2.compat.v1 import audio
31 from tensorflow._api.v2.compat.v1 import autograph
~\miniconda3\envs\tensorflow\lib\site-packages\tensorflow_core_api\v2\compat_init_.py in
37 import sys as _sys
38
---> 39 from . import v1
40 from . import v2
41 from tensorflow.python.compat.compat import forward_compatibility_horizon
~\miniconda3\envs\tensorflow\lib\site-packages\tensorflow_core_api\v2\compat\v1_init_.py in
30 from . import autograph
31 from . import bitwise
---> 32 from . import compat
33 from . import config
34 from . import data
~\miniconda3\envs\tensorflow\lib\site-packages\tensorflow_core_api\v2\compat\v1\compat_init_.py in
37 import sys as _sys
38
---> 39 from . import v1
40 from . import v2
41 from tensorflow.python.compat.compat import forward_compatibility_horizon
~\miniconda3\envs\tensorflow\lib\site-packages\tensorflow_core_api\v2\compat\v1\compat\v1_init_.py in
665 _current_module = _sys.modules[name]
666 try:
--> 667 from tensorflow_estimator.python.estimator.api._v1 import estimator
668 _current_module.path = (
669 [_module_util.get_parent_dir(estimator)] + _current_module.path)
~\AppData\Roaming\Python\Python37\site-packages\tensorflow_estimator_init_.py in
8 import sys as _sys
9
---> 10 from tensorflow_estimator._api.v1 import estimator
11
12 del _print_function
~\AppData\Roaming\Python\Python37\site-packages\tensorflow_estimator_api\v1\estimator_init_.py in
8 import sys as _sys
9
---> 10 from tensorflow_estimator._api.v1.estimator import experimental
11 from tensorflow_estimator._api.v1.estimator import export
12 from tensorflow_estimator._api.v1.estimator import inputs
~\AppData\Roaming\Python\Python37\site-packages\tensorflow_estimator_api\v1\estimator\experimental_init_.py in
8 import sys as _sys
9
---> 10 from tensorflow_estimator.python.estimator.canned.dnn import dnn_logit_fn_builder
11 from tensorflow_estimator.python.estimator.canned.kmeans import KMeansClustering as KMeans
12 from tensorflow_estimator.python.estimator.canned.linear import LinearSDCA
~\AppData\Roaming\Python\Python37\site-packages\tensorflow_estimator\python\estimator\canned\dnn.py in
31 from tensorflow.python.keras.utils import losses_utils
32 from tensorflow.python.util.tf_export import estimator_export
---> 33 from tensorflow_estimator.python.estimator import estimator
34 from tensorflow_estimator.python.estimator.canned import head as head_lib
35 from tensorflow_estimator.python.estimator.canned import optimizers
~\AppData\Roaming\Python\Python37\site-packages\tensorflow_estimator\python\estimator\estimator.py in
51 from tensorflow_estimator.python.estimator import model_fn as model_fn_lib
52 from tensorflow_estimator.python.estimator import run_config
---> 53 from tensorflow_estimator.python.estimator import util as estimator_util
54 from tensorflow_estimator.python.estimator.export import export_lib
55 from tensorflow_estimator.python.estimator.mode_keys import ModeKeys
~\AppData\Roaming\Python\Python37\site-packages\tensorflow_estimator\python\estimator\util.py in
73
74
---> 75 class _DatasetInitializerHook(tf.compat.v1.train.SessionRunHook):
76 """Creates a SessionRunHook that initializes the passed iterator."""
77
AttributeError: module 'tensorflow' has no attribute 'compat'
The text was updated successfully, but these errors were encountered: