安装tensorflow2.1 一import tensorflow就报下面错误 怎么解决
2020-04-02 09:40:07.185822: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cudart64_101.dll
Traceback (most recent call last):
File "C:/Users/zaf/Desktop/jd/test2.py", line 1, in <module>
import tensorflow
File "C:\Program Files\Python\Python37\lib\site-packages\tensorflow\__init__.py", line 101, in <module>
from tensorflow_core import *
File "C:\Program Files\Python\Python37\lib\site-packages\tensorflow_core\__init__.py", line 46, in <module>
from . _api.v2 import compat
File "C:\Program Files\Python\Python37\lib\site-packages\tensorflow_core\_api\v2\compat\__init__.py", line 39, in <module>
from . import v1
File "C:\Program Files\Python\Python37\lib\site-packages\tensorflow_core\_api\v2\compat\v1\__init__.py", line 32, in <module>
from . import compat
File "C:\Program Files\Python\Python37\lib\site-packages\tensorflow_core\_api\v2\compat\v1\compat\__init__.py", line 39, in <module>
from . import v1
File "C:\Program Files\Python\Python37\lib\site-packages\tensorflow_core\_api\v2\compat\v1\compat\v1\__init__.py", line 29, in <module>
from tensorflow._api.v2.compat.v1 import app
File "C:\Program Files\Python\Python37\lib\site-packages\tensorflow_core\_api\v2\compat\__init__.py", line 39, in <module>
from . import v1
File "C:\Program Files\Python\Python37\lib\site-packages\tensorflow_core\_api\v2\compat\v1\__init__.py", line 32, in <module>
from . import compat
File "C:\Program Files\Python\Python37\lib\site-packages\tensorflow_core\_api\v2\compat\v1\compat\__init__.py", line 39, in <module>
from . import v1
File "C:\Program Files\Python\Python37\lib\site-packages\tensorflow_core\_api\v2\compat\v1\compat\v1\__init__.py", line 667, in <module>
from tensorflow_estimator.python.estimator.api._v1 import estimator
File "C:\Program Files\Python\Python37\lib\site-packages\tensorflow_estimator\__init__.py", line 10, in <module>
from tensorflow_estimator._api.v1 import estimator
File "C:\Program Files\Python\Python37\lib\site-packages\tensorflow_estimator\_api\v1\estimator\__init__.py", line 10, in <module>
from tensorflow_estimator._api.v1.estimator import experimental
File "C:\Program Files\Python\Python37\lib\site-packages\tensorflow_estimator\_api\v1\estimator\experimental\__init__.py", line 10, in <module>
from tensorflow_estimator.python.estimator.canned.dnn import dnn_logit_fn_builder
File "C:\Program Files\Python\Python37\lib\site-packages\tensorflow_estimator\python\estimator\canned\dnn.py", line 33, in <module>
from tensorflow_estimator.python.estimator import estimator
File "C:\Program Files\Python\Python37\lib\site-packages\tensorflow_estimator\python\estimator\estimator.py", line 53, in <module>
from tensorflow_estimator.python.estimator import util as estimator_util
File "C:\Program Files\Python\Python37\lib\site-packages\tensorflow_estimator\python\estimator\util.py", line 75, in <module>
class _DatasetInitializerHook(tf.compat.v1.train.SessionRunHook):
AttributeError: module 'tensorflow' has no attribute 'compat'