ContinuumIO / anaconda-issues

Anaconda issue tracking
648 stars 221 forks source link

New Tensorflow-gpu version not detecting gpu #12194

Open Praful932 opened 3 years ago

Praful932 commented 3 years ago

Actual Behavior

GPU is not detected by tensorflow. tf.test.gpu_device_name() gives empty string

Expected Behavior

The GPU should be detected by Tensorflow. This was working on earlier tensorflow-gpu version 2.1(MX150 GPU), on 2.3 it does not work. I followed this tutorial for installing, now the size of tensorflow is also way less 50 mb and size of tf-gpu in kb while installing, earlier it was bigger(>300 mb) than that.

Steps to Reproduce

Create new enivornment and install tf-gpu conda create --name tf_gpu tensorflow-gpu Import tensorflow and check if it detects gpu

Anaconda or Miniconda version:

conda 4.9.2

Operating System:

Windows 10

conda info

conda 4.9.2

``` active environment : tf_gpu active env location : C:\Users\Praful\.conda\envs\tf_gpu shell level : 1 user config file : C:\Users\Praful\.condarc populated config files : C:\Users\Praful\.condarc conda version : 4.9.2 conda-build version : 3.18.11 python version : 3.8.3.final.0 virtual packages : __cuda=11.1=0 __win=0=0 __archspec=1=x86_64 base environment : C:\ProgramData\Anaconda3 (read only) channel URLs : https://repo.anaconda.com/pkgs/main/win-64 https://repo.anaconda.com/pkgs/main/noarch https://repo.anaconda.com/pkgs/r/win-64 https://repo.anaconda.com/pkgs/r/noarch https://repo.anaconda.com/pkgs/msys2/win-64 https://repo.anaconda.com/pkgs/msys2/noarch package cache : C:\ProgramData\Anaconda3\pkgs C:\Users\Praful\.conda\pkgs C:\Users\Praful\AppData\Local\conda\conda\pkgs envs directories : C:\Users\Praful\.conda\envs C:\ProgramData\Anaconda3\envs C:\Users\Praful\AppData\Local\conda\conda\envs platform : win-64 user-agent : conda/4.9.2 requests/2.24.0 CPython/3.8.3 Windows/10 Windows/10.0.18362 administrator : False netrc file : None offline mode : False ```
conda list --show-channel-urls
``` # packages in environment at C:\Users\Praful\.conda\envs\tf_gpu: # # Name Version Build Channel _tflow_select 2.3.0 gpu defaults absl-py 0.11.0 pyhd3eb1b0_1 defaults aiohttp 3.7.3 py38h2bbff1b_1 defaults argon2-cffi 20.1.0 py38he774522_1 defaults astunparse 1.6.3 py_0 defaults async-timeout 3.0.1 py38_0 defaults async_generator 1.10 py_0 defaults attrs 20.3.0 pyhd3eb1b0_0 defaults backcall 0.2.0 py_0 defaults blas 1.0 mkl defaults bleach 3.2.1 py_0 defaults blinker 1.4 py38_0 defaults brotlipy 0.7.0 py38h2bbff1b_1003 defaults ca-certificates 2020.10.14 0 defaults cachetools 4.1.1 py_0 defaults certifi 2020.12.5 py38haa95532_0 defaults cffi 1.14.4 py38hcd4344a_0 defaults chardet 3.0.4 py38haa95532_1003 defaults click 7.1.2 py_0 defaults colorama 0.4.4 py_0 defaults cryptography 3.2.1 py38hcd4344a_1 defaults decorator 4.4.2 py_0 defaults defusedxml 0.6.0 py_0 defaults entrypoints 0.3 py38_0 defaults gast 0.4.0 py_0 defaults google-auth 1.23.0 pyhd3eb1b0_0 defaults google-auth-oauthlib 0.4.2 pyhd3eb1b0_2 defaults google-pasta 0.2.0 py_0 defaults grpcio 1.31.0 py38he7da953_0 defaults h5py 2.10.0 py38h5e291fa_0 defaults hdf5 1.10.4 h7ebc959_0 defaults icc_rt 2019.0.0 h0cc432a_1 defaults idna 2.10 py_0 defaults importlib-metadata 2.0.0 py_1 defaults importlib_metadata 2.0.0 1 defaults intel-openmp 2020.2 254 defaults ipykernel 5.3.4 py38h5ca1d4c_0 defaults ipython 7.19.0 py38hd4e2768_0 defaults ipython_genutils 0.2.0 pyhd3eb1b0_1 defaults jedi 0.17.2 py38haa95532_1 defaults jinja2 2.11.2 py_0 defaults jsonschema 3.2.0 py_2 defaults jupyter_client 6.1.7 py_0 defaults jupyter_core 4.7.0 py38haa95532_0 defaults jupyterlab_pygments 0.1.2 py_0 defaults keras-applications 1.0.8 py_1 defaults keras-preprocessing 1.1.0 py_1 defaults libprotobuf 3.13.0.1 h200bbdf_0 defaults libsodium 1.0.18 h62dcd97_0 defaults m2w64-gcc-libgfortran 5.3.0 6 defaults m2w64-gcc-libs 5.3.0 7 defaults m2w64-gcc-libs-core 5.3.0 7 defaults m2w64-gmp 6.1.0 2 defaults m2w64-libwinpthread-git 5.0.0.4634.697f757 2 defaults markdown 3.3.3 py38haa95532_0 defaults markupsafe 1.1.1 py38he774522_0 defaults mistune 0.8.4 py38he774522_1000 defaults mkl 2020.2 256 defaults mkl-service 2.3.0 py38h196d8e1_0 defaults mkl_fft 1.2.0 py38h45dec08_0 defaults mkl_random 1.1.1 py38h47e9c7a_0 defaults msys2-conda-epoch 20160418 1 defaults multidict 4.7.6 py38he774522_1 defaults nbclient 0.5.1 py_0 defaults nbconvert 6.0.7 py38_0 defaults nbformat 5.0.8 py_0 defaults nest-asyncio 1.4.3 pyhd3eb1b0_0 defaults notebook 6.1.4 py38_0 defaults numpy 1.19.2 py38hadc3359_0 defaults numpy-base 1.19.2 py38ha3acd2a_0 defaults oauthlib 3.1.0 py_0 defaults openssl 1.1.1h he774522_0 defaults opt_einsum 3.1.0 py_0 defaults packaging 20.7 pyhd3eb1b0_0 defaults pandoc 2.11 h9490d1a_0 defaults pandocfilters 1.4.3 py38haa95532_1 defaults parso 0.7.0 py_0 defaults pickleshare 0.7.5 pyhd3eb1b0_1003 defaults pip 20.3.1 py38haa95532_0 defaults prometheus_client 0.9.0 pyhd3eb1b0_0 defaults prompt-toolkit 3.0.8 py_0 defaults protobuf 3.13.0.1 py38ha925a31_1 defaults pyasn1 0.4.8 py_0 defaults pyasn1-modules 0.2.8 py_0 defaults pycparser 2.20 py_2 defaults pygments 2.7.3 pyhd3eb1b0_0 defaults pyjwt 1.7.1 py38_0 defaults pyopenssl 20.0.0 pyhd3eb1b0_1 defaults pyparsing 2.4.7 py_0 defaults pyreadline 2.1 py38_1 defaults pyrsistent 0.17.3 py38he774522_0 defaults pysocks 1.7.1 py38haa95532_0 defaults python 3.8.5 h5fd99cc_1 defaults python-dateutil 2.8.1 py_0 defaults pywin32 227 py38he774522_1 defaults pywinpty 0.5.7 py38_0 defaults pyzmq 20.0.0 py38hd77b12b_1 defaults requests 2.25.0 pyhd3eb1b0_0 defaults requests-oauthlib 1.3.0 py_0 defaults rsa 4.6 py_0 defaults scipy 1.5.2 py38h14eb087_0 defaults send2trash 1.5.0 py38_0 defaults setuptools 51.0.0 py38haa95532_2 defaults six 1.15.0 py38haa95532_0 defaults sqlite 3.33.0 h2a8f88b_0 defaults tensorboard 2.3.0 pyh4dce500_0 defaults tensorboard-plugin-wit 1.6.0 py_0 defaults tensorflow 2.3.0 mkl_py38h8557ec7_0 defaults tensorflow-base 2.3.0 eigen_py38h75a453f_0 defaults tensorflow-estimator 2.3.0 pyheb71bc4_0 defaults tensorflow-gpu 2.3.0 he13fc11_0 defaults termcolor 1.1.0 py38_1 defaults terminado 0.9.1 py38_0 defaults testpath 0.4.4 py_0 defaults tornado 6.1 py38h2bbff1b_0 defaults traitlets 5.0.5 py_0 defaults typing-extensions 3.7.4.3 0 defaults typing_extensions 3.7.4.3 py_0 defaults urllib3 1.25.11 py_0 defaults vc 14.2 h21ff451_1 defaults vs2015_runtime 14.27.29016 h5e58377_2 defaults wcwidth 0.2.5 py_0 defaults webencodings 0.5.1 py38_1 defaults werkzeug 1.0.1 py_0 defaults wheel 0.36.1 pyhd3eb1b0_0 defaults win_inet_pton 1.1.0 py38haa95532_0 defaults wincertstore 0.2 py38_0 defaults winpty 0.4.3 4 defaults wrapt 1.12.1 py38he774522_1 defaults yarl 1.5.1 py38he774522_0 defaults zeromq 4.3.3 ha925a31_3 defaults zipp 3.4.0 pyhd3eb1b0_0 defaults zlib 1.2.11 h62dcd97_4 defaults ```
Praful932 commented 3 years ago

For now fixed this with a workaround - normal tensorflow installation (Edit : In a separate Python virtual environment not conda)

Note : Remove Geforce Experience if you have, does not work with CUDA

  • Install the prerequisite software requirements from here with proper versions.
  • pip install tensorflow (Preferrably in a virtual environment)

Should detect GPU now, check with this command - tf.test.gpu_device_name()

grudloff commented 3 years ago

Hello! Having the same issue here. Isn't it advised not to install packages with pip on a conda enviroment?

PD: I tried your workaround but had no success, but pip install tensorflow-gpu did the trick.

Praful932 commented 3 years ago

Not conda, I installed it in a separate python virtual environment

451488975 commented 3 years ago

I encountered this problem too when I installed tensorflow-gpu in a new conda environment. I checked all the packages it installed in which I cannot find cudatoolkit and cudnn which seems to be the reason why it cannot detect gpu, I tried to manually install cudatoolkit and cudnn by conda install cudatoolkit cudnn but have no luck of success. I solved this by using conda install tensorflow-gpu=2.1, the old version works fine with all the dependencies.

ZOUG commented 3 years ago

It looks like the issue is that the installation engine selects a faulty tensorflow build during the process (cf. see this post). A workaround for now is to explicitly specify the correct tensorflow build.

Python 3.7: conda install tensorflow-gpu=2.3 tensorflow=2.3=mkl_py37h936c3e2_0 Python 3.8: conda install tensorflow-gpu=2.3 tensorflow=2.3=mkl_py38h1fcfbd6_0

tommyxu97 commented 3 years ago

It looks like the issue is that the installation engine selects a faulty tensorflow build during the process (cf. see this post). A workaround for now is to explicitly specify the correct tensorflow build.

Python 3.7: conda install tensorflow-gpu=2.3 tensorflow=2.3=mkl_py37h936c3e2_0 Python 3.8: conda install tensorflow-gpu=2.3 tensorflow=2.3=mkl_py38h1fcfbd6_0

It works out for me. Thanks very much!

ghost commented 3 years ago

Thank you very much! I have been searching for hours trying to find a solution.

sujaybokil commented 3 years ago

It looks like the issue is that the installation engine selects a faulty tensorflow build during the process (cf. see this post). A workaround for now is to explicitly specify the correct tensorflow build.

Python 3.7: conda install tensorflow-gpu=2.3 tensorflow=2.3=mkl_py37h936c3e2_0 Python 3.8: conda install tensorflow-gpu=2.3 tensorflow=2.3=mkl_py38h1fcfbd6_0

It works for me, thank you very much!

parmenashp commented 3 years ago

It looks like the issue is that the installation engine selects a faulty tensorflow build during the process (cf. see this post). A workaround for now is to explicitly specify the correct tensorflow build. Python 3.7: conda install tensorflow-gpu=2.3 tensorflow=2.3=mkl_py37h936c3e2_0 Python 3.8: conda install tensorflow-gpu=2.3 tensorflow=2.3=mkl_py38h1fcfbd6_0

Thank you, i just spent the whole night trying to fix that

sarosijbose commented 3 years ago

Thanks for raising this issue here as well. I had asked this same question on Stack Overflow and a couple of guys have given some alternate answers there. Although @ZOUG provides an excellent one-liner solution, in case anyone is interested or the solution provided here is not working due to some reason you may want to check out https://stackoverflow.com/questions/65273118/why-is-tensorflow-not-recognizing-my-gpu-after-conda-install link. (Note that mixing conda with pip isn't always the right thing to do).

GrigoriiTarasov commented 3 years ago

ZOUG hack seem not to work now:

PackagesNotFoundError: The following packages are not available from current channels:

  - tensorflow==2.3=mkl_py37h936c3e2_0
  - tensorflow-gpu=2.3

Current channels:

  - https://repo.anaconda.com/pkgs/main/linux-64
  - https://repo.anaconda.com/pkgs/main/noarch
  - https://repo.anaconda.com/pkgs/r/linux-64
  - https://repo.anaconda.com/pkgs/r/noarch
  - https://conda.anaconda.org/conda-forge/linux-64
  - https://conda.anaconda.org/conda-forge/noarch

My setup is !python -V Python 3.7.6

ZOUG commented 3 years ago

ZOUG hack seem not to work now:

PackagesNotFoundError: The following packages are not available from current channels:

  - tensorflow==2.3=mkl_py37h936c3e2_0
  - tensorflow-gpu=2.3

Current channels:

  - https://repo.anaconda.com/pkgs/main/linux-64
  - https://repo.anaconda.com/pkgs/main/noarch
  - https://repo.anaconda.com/pkgs/r/linux-64
  - https://repo.anaconda.com/pkgs/r/noarch
  - https://conda.anaconda.org/conda-forge/linux-64
  - https://conda.anaconda.org/conda-forge/noarch

My setup is !python -V Python 3.7.6

@GrigoriiTarasov In the official Anaconda channel, tensorflow-gpu 2.3 is available only for Windows but not for Linux.

tom-andersson commented 3 years ago

Is there a workaround for Linux?

ZOUG commented 3 years ago

Is there a workaround for Linux?

For now you could try this new (testing) build of Tensorflow 2.4.1 from @katietz's private channel: conda install -c ktietz tensorflow-gpu

If you find any issues, post your feedbacks under this post.

tom-andersson commented 3 years ago

Thanks @ZOUG, I will try that if I end up needing TensorFlow 2.4. I decided to stick with the official Anaconda channel and just downgrade to get GPU detection working on my Linux system.

In case this helps others: I ended up downgrading to TensorFlow 2.2.0 and using a build from the official Anaconda channel with the gpu prefix: conda install tensorflow==2.2.0=gpu_py38hb782248_0

This ensures the correct cuda and cudnn versions are installed and it detects my GPU, unlike the broken TF 2.3 build.

ZOUG commented 3 years ago

Thanks @ZOUG, I will try that if I end up needing TensorFlow 2.4. I decided to stick with the official Anaconda channel and just downgrade to get GPU detection working on my Linux system.

In case this helps others: I ended up downgrading to TensorFlow 2.2.0 and using a build from the official Anaconda channel with the gpu prefix: conda install tensorflow==2.2.0=gpu_py38hb782248_0

This ensures the correct cuda and cudnn versions are installed and it detects my GPU, unlike the broken TF 2.3 build.

If you need TF 2.3+, another option is to use pip (see this post) to perform the upgrade.

AlexanderDuvall commented 3 years ago

It looks like the issue is that the installation engine selects a faulty tensorflow build during the process (cf. see this post). A workaround for now is to explicitly specify the correct tensorflow build.

Python 3.7: conda install tensorflow-gpu=2.3 tensorflow=2.3=mkl_py37h936c3e2_0 Python 3.8: conda install tensorflow-gpu=2.3 tensorflow=2.3=mkl_py38h1fcfbd6_0

This is THE solution for windows users. I encourage people to try this before blowing up conda!

sujaybokil commented 3 years ago

For me , it works if I install cudatoolkit and cudnn using conda install cudatoolkit==10.1.243 cudnn and then install tensorflow using conda install tensorflow-gpu for both Windows 10 and WSL 2

Note: It doesn't work it I install the other way round

grudloff commented 3 years ago

I found a workaround for installing tf>2.3 on Windows. It looks like conda-forge has cudnn 8.2 and cudatoolkit 11.2, required for the latest build. So they can be installed with conda install -c conda-forge cudnn and then tf2.5 can be installed with pip install tensorflow.

Remember that to associate pip to the current env you should first run conda install pip on it.

Mashfiq137 commented 3 years ago

It looks like the issue is that the installation engine selects a faulty tensorflow build during the process (cf. see this post). A workaround for now is to explicitly specify the correct tensorflow build.

Python 3.7: conda install tensorflow-gpu=2.3 tensorflow=2.3=mkl_py37h936c3e2_0 Python 3.8: conda install tensorflow-gpu=2.3 tensorflow=2.3=mkl_py38h1fcfbd6_0

you a god or what? ;-; @ZOUG this worked for me. nearly cried ;-;

hestella commented 3 years ago

It looks like the issue is that the installation engine selects a faulty tensorflow build during the process (cf. see this post). A workaround for now is to explicitly specify the correct tensorflow build.

Python 3.7: conda install tensorflow-gpu=2.3 tensorflow=2.3=mkl_py37h936c3e2_0 Python 3.8: conda install tensorflow-gpu=2.3 tensorflow=2.3=mkl_py38h1fcfbd6_0

Finally worked:D Thank you

randomgambit commented 3 years ago

It looks like the issue is that the installation engine selects a faulty tensorflow build during the process (cf. see this post). A workaround for now is to explicitly specify the correct tensorflow build. Python 3.7: conda install tensorflow-gpu=2.3 tensorflow=2.3=mkl_py37h936c3e2_0 Python 3.8: conda install tensorflow-gpu=2.3 tensorflow=2.3=mkl_py38h1fcfbd6_0

It works out for me. Thanks very much!

saved my life. Thanks!!!!!

grudloff commented 3 years ago

tensorflow-gpu was just updated for windows to 2.5.0 on anaconda's main channel. Seems to be working fine!

lyh16 commented 3 years ago

For some reason, I couldn't get tensorflow-gpu v2.5.0 to detect my GPU on my JupyterHub environment, despite the many answers on the internet. I found a way to get tensorflow-gpu v2.4.1 to work as expected on JupyterHub+RTX 3090. If none of the suggested answers work, give it a go. My configuration works fine now!

https://github.com/tensorflow/tensorflow/issues/45930#issuecomment-877777803

yuanqingye commented 3 years ago

It looks like the issue is that the installation engine selects a faulty tensorflow build during the process (cf. see this post). A workaround for now is to explicitly specify the correct tensorflow build.

Python 3.7: conda install tensorflow-gpu=2.3 tensorflow=2.3=mkl_py37h936c3e2_0 Python 3.8: conda install tensorflow-gpu=2.3 tensorflow=2.3=mkl_py38h1fcfbd6_0

This works for my issue

michaelkarlcoleman commented 3 years ago

Just an update: It appears this bug is still present. On Linux, we're currently working around using something like this, in case it may be useful to others.

    conda create --override-channels --name anaconda-tensorflow2-gpu-20210928-nvidiatest -c nvidia -c defaults -c conda-forge pytorch-gpu numpy  'cudatoolkit<11.3' 'cudatoolkit>=11'
    (conda activate anaconda-tensorflow2-gpu-20210928-nvidiatest && pip3 install tensorflow)

(The cudatoolkit constraints are due to us not having the latest kernel driver yet.)

keishk commented 3 years ago

It looks like the issue is that the installation engine selects a faulty tensorflow build during the process (cf. see this post). A workaround for now is to explicitly specify the correct tensorflow build.

Python 3.7: conda install tensorflow-gpu=2.3 tensorflow=2.3=mkl_py37h936c3e2_0 Python 3.8: conda install tensorflow-gpu=2.3 tensorflow=2.3=mkl_py38h1fcfbd6_0

Is there a corresponding version for Python 3.9? Thanks

GrigoriiTarasov commented 3 years ago

Just an update: It appears this bug is still present. On Linux, we're currently working around using something like this, in case it may be useful to others.

    conda create --override-channels --name anaconda-tensorflow2-gpu-20210928-nvidiatest -c nvidia -c defaults -c conda-forge pytorch-gpu numpy  'cudatoolkit<11.3' 'cudatoolkit>=11'
    (conda activate anaconda-tensorflow2-gpu-20210928-nvidiatest && pip3 install tensorflow)

(The cudatoolkit constraints are due to us not having the latest kernel driver yet.)

Thanks for you suggestion, Michael! Can you please clarify what version of py does it fit? Does this way have advantages over "conda install tensorflow==2.2.0=gpu_py38hb782248_0"?

I've made some variation to try to meet my needs:

conda create --override-channels --name cuda_cond_hack -c nvidia -c defaults -c conda-forge pytorch-gpu numpy 'cudatoolkit<11.3' 'cudatoolkit>=11' python=3.7.0 conda activate cuda_cond_hack pip3 install tensorflow conda install keras-ocr

but it lead to such conda conflicts: https://pastebin.com/tVGYUYcw

Omega-84 commented 2 years ago

It looks like the issue is that the installation engine selects a faulty tensorflow build during the process (cf. see this post). A workaround for now is to explicitly specify the correct tensorflow build.

Python 3.7: conda install tensorflow-gpu=2.3 tensorflow=2.3=mkl_py37h936c3e2_0 Python 3.8: conda install tensorflow-gpu=2.3 tensorflow=2.3=mkl_py38h1fcfbd6_0

worked like a charm, thanks man, god bless you

purplefan204 commented 2 years ago

It looks like the issue is that the installation engine selects a faulty tensorflow build during the process (cf. see this post). A workaround for now is to explicitly specify the correct tensorflow build.

Python 3.7: conda install tensorflow-gpu=2.3 tensorflow=2.3=mkl_py37h936c3e2_0 Python 3.8: conda install tensorflow-gpu=2.3 tensorflow=2.3=mkl_py38h1fcfbd6_0

Worked well for me! Thanks a ton!

Noshi96 commented 2 years ago

For me: Windows 10, Python 3.8.12, conda 4.12.0

To get it working, I had to follow the steps below:

  1. Download and install CUDA Toolkit 11.6 Update 2 https://developer.nvidia.com/cuda-downloads?target_os=Windows&target_arch=x86_64&target_version=10&target_type=exe_local

  2. Run the following commands in the Conda terminal:

    pip uninstall protobuf
    pip uninstall tensorflow
    pip install --upgrade --force-reinstall --user tensorflow-gpu
    pip install --upgrade tensorflow-gpu

    restart PC

ZOUG commented 2 years ago

For me: Windows 10, Python 3.8.12, conda 4.12.0

To get it working, I had to follow the steps below:

  1. Download and install CUDA Toolkit 11.6 Update 2 https://developer.nvidia.com/cuda-downloads?target_os=Windows&target_arch=x86_64&target_version=10&target_type=exe_local
  2. Run the following commands in the Conda terminal:
pip uninstall protobuf
pip uninstall tensorflow
pip install --upgrade --force-reinstall --user tensorflow-gpu
pip install --upgrade tensorflow-gpu

restart PC

Installing packages using pip in a conda environment would keep the packages out of conda's management system (conflict resolution, dependency management, etc.). Therefore it is normally only adopted as the last resort and not recommended as a common practice.

cmmarellano commented 2 years ago

It looks like the issue is that the installation engine selects a faulty tensorflow build during the process (cf. see this post). A workaround for now is to explicitly specify the correct tensorflow build.

Python 3.7: conda install tensorflow-gpu=2.3 tensorflow=2.3=mkl_py37h936c3e2_0 Python 3.8: conda install tensorflow-gpu=2.3 tensorflow=2.3=mkl_py38h1fcfbd6_0

This works. Thanks! @ZOUG I am working on Win10, conda 4.12, Python 3.7, and previously had the same issue with "no gpu detected", including "no module tensorflow_estimation" . This is what I initially had (Anaconda's default tensorflow installation: tensorflow=2.1, tensorflow_estimator=2.6).

I suggest to work on a new env (rather than uninstalling, downgrading or upgrading) and fresh install tensorflow using the suggested code above. This will save you a lot of time in the case that you encounter multiple package conflicts.

Running this code: import tensorflow as tf print("Num GPUs Available: ", len(tf.config.list_physical_devices('GPU'))) now gives me: Num GPUs Available: 1

Works like a charm! :)

giveo-logan commented 1 year ago

Please note that tensorflow's gpu is no longer supported on Windows native per their documentation.

Caution: TensorFlow 2.10 was the last TensorFlow release that supported GPU on native-Windows. Starting with TensorFlow 2.11, you will need to install [TensorFlow in WSL2](https://tensorflow.org/install/pip#windows-wsl2), or install tensorflow-cpu and, optionally, try the [TensorFlow-DirectML-Plugin](https://github.com/microsoft/tensorflow-directml-plugin#tensorflow-directml-plugin-)

https://www.tensorflow.org/install/pip#windows-native