我的报错是:
Use `tf.config.list_physical_devices('GPU')` instead.
2024-03-28 17:01:46.724677: I tensorflow/core/platform/cpu_feature_guard.cc:142] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN) to use the following CPU instructions in performance-critical operations: AVX AVX2
To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.
2024-03-28 17:01:52.455207: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'cublasLt64_11.dll'; dlerror: cublasLt64_11.dll not found
2024-03-28 17:02:01.291449: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'cusparse64_11.dll'; dlerror: cusparse64_11.dll not found
2024-03-28 17:02:01.293602: W tensorflow/core/common_runtime/gpu/gpu_device.cc:1835] 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...
其实tensorflow对cuda和cudnn的版本比较严格,这就整得很麻烦了,不像pytorch一样方便。所以看看下面对应的版本信息,安装对应的cuda和cudnn即可。
这些都是官网给的数据,后期可能还有新的版本,那可以可以在这里查看:https://www.tensorflow.org/install/source_windows?hl=zh-cn#tested_build_configurations