Search code examples
pythongputensorflow2.0

GPU issues when using Tensorflow2 to train a chatbot


I’m having trouble using the GPU to run Tensorflow2. I’m trying to train a chatbot, but the GPU doesn’t show up for me to use. I’ve tried everything and can’t get it to work. Here are the details I can provide:

  • CUDA Toolkit == 10.1
  • cuDNN == 8.0.5
  • Tensorflow == 2.12.0
  • Keras == 2.12.0
  • Python == 3.10 and 3.8 and 3.9

My settings:

  • Processor I9-10900k
  • GPU: GTX 1050 TI 4GB
  • Windows 11

Can anyone help me solve this problem? Thank you in advance for any help you can provide!

Script I used to check:

import tensorflow as tf

print("Num GPUs Available: ", len(tf.config.list_physical_devices('GPU')))

if tf.test.is_built_with_cuda():
    print("TensorFlow was built with CUDA support.")
else:
    print("TensorFlow was not built with CUDA support.")

print("TensorFlow version: ", tf.__version__)
print(tf.config.experimental.get_device_policy())

terminal exit:

Num GPUs Available:  0
TensorFlow was not built with CUDA support.
TensorFlow version:  2.10.0
silent

Solution

  • You can check the installation page in the TensorFlow documentation. "GPU Support on native-Windows is only available for 2.10 or earlier Versions".

    When using TensorFlow 2.10 the following Versions are listed:

    Version Python version Compiler Build tools cuDNN CUDA
    tensorflow_gpu-2.10.0 3.7-3.10 MSVC 2019 Bazel 5.1.1 8.1 11.2

    Make sure you have the correct versions installed.