I can see that this question has been asked before here tensorflow-has-no-attribute-compat
but the answer given was to
Microsoft Visual C++ 2015-2019 R
This is usually caused by the broken TensorFlow-estimator module.
simply do a
pip install tensorflow-estimator==2.1.*
the specs you have given are correct
tensorflow-gpu 2.1
python 3.7.7
CUDA 10.1
Anaconda 3.7
but in tensorflow 2.X first install
pip install tensorflow-estimator==2.1.*
then install
pip install tensorflow-gpu
and then run the following command to check the number of gpu
import tensorflow as tf
print("Num GPUs Available: ", len(tf.config.experimental.list_physical_devices('GPU')))
i hope it will work
Special note for Conda users:
When one enters conda install tensorflow
it installs 2.1.0 but it brings with it tensorflow-estimator 2.2.0. To fix this problem simply run conda install tensorflow-estimator==2.1.0
after installing tensorflow 2.1.0 in Conda.
This advice is valid until conda switches to TF 2.2.0 (or better yet to 2.3.0)
credits to this TF github thread
UPDATE: as of 10-Dec-2020 Conda has TF 2.3.0 for Windows and 2.2.0 for Linux. Check here to see current state of TF support in Conda.
Below solution worked for me. Reference
First install Estimator=2.1 then the rest:
conda remove tensorflow
conda install tensorflow-estimator 2.1
conda install tensorflow-gpu=2.1