添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接

Hi all,
i have meet a problem that i cannot activate tensorflow by GPU.
tf.config.list_physical_devices(‘GPU’) =
the version of tool and softare Condition as below

  • Window 11, 22H2
  • Nvidia Geforce RTX 3060Ti
  • Hardware driver: 532.03
  • Python: 3.10.9
  • tensorflow:2.12.0
  • Cuda: 12.1
  • cuDNN: 8.9.1
  • not sure whether those version is compatible,
    if the version is compatiable and also follow install process, can someone share any suggestion to activate the GPU for tensorflow.
    thanks

    not sure whether those version is compatible,

    No, GPU support on native-Windows is only available for 2.10 or earlier versions, starting in TF 2.11 CUDA build is not supported for Windows.

    For using Tensorflow GPU on windows, you will need to build/install Tensorflow in WSL2 or use tensorflow-cpu with TensorFlow-DirectML-Plugin .

    Thank you!

    Hi Chunduriv

    should i have to downgrade cuda/cuDNN version for TF 2.11?
    on the other hand, we try to pip install tensorflow-gpu ,but i get below error: subprocess-exited-with-error

    Collecting tensorflow-gpu
    Using cached tensorflow-gpu-2.12.0.tar.gz (2.6 kB)
    Preparing metadata (setup.py) … done
    Requirement already satisfied: python_version>“3.7” in c:\users\user\anaconda3\lib\site-packages (from tensorflow-gpu) (0.0.2)
    Building wheels for collected packages: tensorflow-gpu
    Building wheel for tensorflow-gpu (setup.py) … error
    error: subprocess-exited-with-error

    × python setup.py bdist_wheel did not run successfully.
    │ exit code: 1
    ╰─> [18 lines of output]
    Traceback (most recent call last):
    File “”, line 2, in
    File “”, line 34, in
    File “C:\Users\User\AppData\Local\Temp\pip-install-i33omk_i\tensorflow-gpu_94f98365580a487ea63d546e15fdb54c\setup.py”, line 37, in
    raise Exception(TF_REMOVAL_WARNING)
    Exception:

      =========================================================
      The "tensorflow-gpu" package has been removed!
      Please install "tensorflow" instead.
      Other than the name, the two packages have been identical
      since TensorFlow 2.1, or roughly since Sep 2019. For more
      information, see: pypi.org/project/tensorflow-gpu
      =========================================================
    

    how can i success to active my GPU function for tensorflow?
    thanks

    how can i success to active my GPU function for tensorflow?

    Even TF 2.11 doesn’t work on Windows. Install TF 2.10 if you wish to use the GPU on Windows.

    After creating a conda environment, you can follow below steps for GPU setup:

    conda install -c conda-forge cudatoolkit=11.2 cudnn=8.1.0
    python -m pip install tensorflow=2.10
    python -c "import tensorflow as tf; print(tf.config.list_physical_devices('GPU'))"
    

    For more details please refer to step by step instructions.

    Collecting tensorflow-gpu
    Using cached tensorflow-gpu-2.12.0.tar.gz (2.6 kB)
    Preparing metadata (setup.py) … done
    Requirement already satisfied: python_version>“3.7” in c:\users\user\anaconda3\lib\site-packages (from tensorflow-gpu) (0.0.2)
    Building wheels for collected packages: tensorflow-gpu
    Building wheel for tensorflow-gpu (setup.py) … error
    error: subprocess-exited-with-error

    × python setup.py bdist_wheel did not run successfully.
    │ exit code: 1
    ╰─> [18 lines of output]
    Traceback (most recent call last):
    File “”, line 2, in
    File “”, line 34, in
    File “C:\Users\User\AppData\Local\Temp\pip-install-i33omk_i\tensorflow-gpu_94f98365580a487ea63d546e15fdb54c\setup.py”, line 37, in
    raise Exception(TF_REMOVAL_WARNING)
    Exception:

    tensorflow-gpu has been removed. Please install tensorflow instead. The tensorflow package supports GPU accelerated operations via Nvidia CUDA. For more details please refer to tensorflow-gpu · PyPI

    Thank you!

    Hi @chunduriv
    million thanks for your comment, we successful install it.

    “[PhysicalDevice(name=‘/physical_device:GPU:0’, device_type=‘GPU’)]”

    and we can process tensorflow by GPU
    thanks a lot~~