最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

python - Cannot see the GPU when using Tensorflow - Stack Overflow

programmeradmin5浏览0评论

GPU: Nvidia GeForce RTX 4070 Laptop CUDA: version 11.8 Cudnn: present

Cuda is present in the env variables path

Python: 3.10 Tensorflow: version 2.18.0

Working with poetry, however installed with pip

import tensorflow as tf
import os

print(f"CUDA: {tf.test.is_built_with_cuda()}")

gpus = tf.config.experimental.list_physical_devices('GPU')
print(f"GPUs: {gpus}")

It prints "CUDA: false" and "GPUs: []" into the terminal

  1. I have tried other versions of python. Did not help.
  2. I tried to install tensorflow-gpu, however it game an error. Additionally, most resources said the gpu support is already integrated into tensorflow.
  3. I did change the version of Tensorflow to be compatible with Cuda, however it still gives me an empty array
发布评论

评论列表(0)

  1. 暂无评论