Please go to the latest update article here https://www.yodiw.com/fix-install-tensorflow-2-with-gpu-simple-version-2023/Author
This tutorial will help you to run Tensorflow in Windows 11 to use GPU for modelling, with the latest Visual Studio, CUDA and latest drivers. In this case, I’m using RTX 3060Ti Lite Hashes and Python 3.7 – 3.10 for Windows. (I use Python 3.10.9)
We need to install
- Clean Windows Installation and GPU drivers card
- the Microsoft Visual C++ (MSVC) compiler 2022
- the CUDA Toolkit 11.8
- the cuDNN libraries
- Install tensorflow
1. Windows fresh installation to remove the complexity of issues or bugs is recommended here. I did re-install my Windows 11 in this step
2. Instead of using Nvidia Geforce Experience, I uninstall the GPU drivers (back to Microsoft Basic) and use NVCleanstall to download my RTX 3060 drivers without others bloatware https://www.techpowerup.com/download/techpowerup-nvcleanstall/
3. I use Python 3.9 from Anaconda https://www.anaconda.com/products/distribution
We need to install Microsoft Visual Studio 2022, which it will required by CUDA for integration. You can download the community version and check for C/C++ development installation
Download the CUDNN via Conda and check the latest packages
conda search -c nvidia cudatoolkit conda search -c nvidia cudnn
conda install -c conda-forge cudatoolkit=11.5.0 cudnn=8.2.1
Now, we are ready to install tensorflow (If you are using Python 3.11, you may have issue with tensorflow pip installation)
python -m pip install "tensorflow<2.11"
Now, you can test the tensorflow now working using GPU RTX Nvidia.
python -c "import tensorflow as tf; print(tf.config.list_physical_devices('GPU'))"
If not working, then install CUDA 11 at here https://developer.nvidia.com/cuda-toolkit