The easiest way that I found to fix this is to uninstall everything then install a specific version of tensorflow-gpu:
pip uninstall tensorflow
pip uninstall tensorflow-gpu
pip install tensorflow-gpu==2.0.0
pip install tensorflow_hub
pip install tensorflow_datasets
You can check if this worked by adding the following code into a python file:
from __future__ import absolute_import, division, print_function, unicode_literals
import numpy as np
import tensorflow as tf
import tensorflow_hub as hub
import tensorflow_datasets as tfds
print("Version: ", tf.__version__)
print("Eager mode: ", tf.executing_eagerly())
print("Hub Version: ", hub.__version__)
print("GPU is", "available" if tf.config.experimental.list_physical_devices("GPU") else "NOT AVAILABLE")
Run the file and then the output should be something like this:
Version: 2.0.0
Eager mode: True
Hub Version: 0.7.0
GPU is available
Hope this helps