tf.config.list_physical_devices('GPU')
2023-09-27 09:54:25.182349: W tensorflow/core/common_runtime/gpu/gpu_device.cc:1850] Cannot dlopen some GPU libraries. Please make sure the missing libraries mentioned above are installed properly if you would like to use GPU. Follow the guide at https://www.tensorflow.org/install/gpu for how to download and setup the required libraries for your platform.
Skipping registering GPU devices...
服务器配置:
pytorch: 2.0.1+cu117
Cuda: 11.7
Cudnn: 8500
Tensorflow: 2.13.0
后来发现是cudnn的库没配好:
在官网cuDNN Archive | NVIDIA Developer下载tar安装包,重新安装了cudnn的库cudnn-linux-x86_64-8.6.0.163_cuda10-archive(安装步骤参照Installation Guide - NVIDIA Docs)
就解决了