cuda版本查看 nvcc -V
cudnn 版本查看
find / -name cudnn_version.h
找到对应的文件
find: '/proc/tty/driver': Permission denied
/usr/include/cudnn_version.h
/opt/conda/envs/python35-paddle120-env/lib/python3.10/site-packages/nvidia/cudnn/include/cudnn_version.h
find: '/root': Permission denied
find: '/var/lib/apt/lists/partial': Permission denied
find: '/var/lib/private': Permission denied
find: '/var/log/private': Permission denied
find: '/var/cache/ldconfig': Permission denied
find: '/var/cache/apt/archives/partial': Permission denied
find: '/var/cache/private': Permission denied
find: '/run/sudo': Permission denied
/home/aistudio/external-libraries/nvidia/cudnn/include/cudnn_version.h
find: '/etc/ssl/private': Permission denied
baidu aistutdiou是
cd /opt/conda/envs/python35-paddle120-env/lib/python3.10/site-packages/nvidia/cudnn/include
cudnn_version.h | grep CUDNN_MAJOR -A 2
1. 官方配置
官网除了中文(包括简体和繁体)之外的才更新到了TensorFlow 2.18.0,中文版只更新到了2.6.0,所以要想看到下面的内容需要进入官网之后右上角将语言选择为English。
经过测试的构建配置
Linux
CPU
Version | Python version | Compiler | Build tools |
---|---|---|---|
tensorflow-2.18.0 | 3.9-3.12 | Clang 17.0.6 | Bazel 6.5.0 |
tensorflow-2.17.0 | 3.9-3.12 | Clang 17.0.6 | Bazel 6.5.0 |
tensorflow-2.16.1 | 3.9-3.12 | Clang 17.0.6 | Bazel 6.5.0 |
tensorflow-2.15.0 | 3.9-3.11 | Clang 16.0.0 | Bazel 6.1.0 |
tensorflow-2.14.0 | 3.9-3.11 | Clang 16.0.0 | Bazel 6.1.0 |
tensorflow-2.13.0 | 3.8-3.11 | Clang 16.0.0 | Bazel 5.3.0 |
tensorflow-2.12.0 | 3.8-3.11 | GCC 9.3.1 | Bazel 5.3.0 |
tensorflow-2.11.0 | 3.7-3.10 | GCC 9.3.1 | Bazel 5.3.0 |
tensorflow-2.10.0 | 3.7-3.10 | GCC 9.3.1 | Bazel 5.1.1 |
tensorflow-2.9.0 | 3.7-3.10 | GCC 9.3.1 | Bazel 5.0.0 |
tensorflow-2.8.0 | 3.7-3.10 | GCC 7.3.1 | Bazel 4.2.1 |
tensorflow-2.7.0 | 3.7-3.9 | GCC 7.3.1 | Bazel 3.7.2 |
tensorflow-2.6.0 | 3.6-3.9 | GCC 7.3.1 | Bazel 3.7.2 |
tensorflow-2.5.0 | 3.6-3.9 | GCC 7.3.1 | Bazel 3.7.2 |
tensorflow-2.4.0 | 3.6-3.8 | GCC 7.3.1 | Bazel 3.1.0 |
tensorflow-2.3.0 | 3.5-3.8 | GCC 7.3.1 | Bazel 3.1.0 |
tensorflow-2.2.0 | 3.5-3.8 | GCC 7.3.1 | Bazel 2.0.0 |
tensorflow-2.1.0 | 2.7, 3.5-3.7 | GCC 7.3.1 | Bazel 0.27.1 |
tensorflow-2.0.0 | 2.7, 3.3-3.7 | GCC 7.3.1 | Bazel 0.26.1 |
tensorflow-1.15.0 | 2.7, 3.3-3.7 | GCC 7.3.1 | Bazel 0.26.1 |
tensorflow-1.14.0 | 2.7, 3.3-3.7 | GCC 4.8 | Bazel 0.24.1 |
tensorflow-1.13.1 | 2.7, 3.3-3.7 | GCC 4.8 | Bazel 0.19.2 |
tensorflow-1.12.0 | 2.7, 3.3-3.6 | GCC 4.8 | Bazel 0.15.0 |
tensorflow-1.11.0 | 2.7, 3.3-3.6 | GCC 4.8 | Bazel 0.15.0 |
tensorflow-1.10.0 | 2.7, 3.3-3.6 | GCC 4.8 | Bazel 0.15.0 |
tensorflow-1.9.0 | 2.7, 3.3-3.6 | GCC 4.8 | Bazel 0.11.0 |
tensorflow-1.8.0 | 2.7, 3.3-3.6 | GCC 4.8 | Bazel 0.10.0 |
tensorflow-1.7.0 | 2.7, 3.3-3.6 | GCC 4.8 | Bazel 0.10.0 |
tensorflow-1.6.0 | 2.7, 3.3-3.6 | GCC 4.8 | Bazel 0.9.0 |
tensorflow-1.5.0 | 2.7, 3.3-3.6 | GCC 4.8 | Bazel 0.8.0 |
tensorflow-1.4.0 | 2.7, 3.3-3.6 | GCC 4.8 | Bazel 0.5.4 |
tensorflow-1.3.0 | 2.7, 3.3-3.6 | GCC 4.8 | Bazel 0.4.5 |
tensorflow-1.2.0 | 2.7, 3.3-3.6 | GCC 4.8 | Bazel 0.4.5 |
tensorflow-1.1.0 | 2.7, 3.3-3.6 | GCC 4.8 | Bazel 0.4.2 |
tensorflow-1.0.0 | 2.7, 3.3-3.6 | GCC 4.8 | Bazel 0.4.2 |
GPU
Version | Python version | Compiler | Build tools | cuDNN | CUDA |
---|---|---|---|---|---|
tensorflow-2.18.0 | 3.9-3.12 | Clang 17.0.6 | Bazel 6.5.0 | 9.3 | 12.5 |
tensorflow-2.17.0 | 3.9-3.12 | Clang 17.0.6 | Bazel 6.5.0 | 8.9 | 12.3 |
tensorflow-2.16.1 | 3.9-3.12 | Clang 17.0.6 | Bazel 6.5.0 | 8.9 | 12.3 |
tensorflow-2.15.0 | 3.9-3.11 | Clang 16.0.0 | Bazel 6.1.0 | 8.9 | 12.2 |
tensorflow-2.14.0 | 3.9-3.11 | Clang 16.0.0 | Bazel 6.1.0 | 8.7 | 11.8 |
tensorflow-2.13.0 | 3.8-3.11 | Clang 16.0.0 | Bazel 5.3.0 | 8.6 | 11.8 |
tensorflow-2.12.0 | 3.8-3.11 | GCC 9.3.1 | Bazel 5.3.0 | 8.6 | 11.8 |
tensorflow-2.11.0 | 3.7-3.10 | GCC 9.3.1 | Bazel 5.3.0 | 8.1 | 11.2 |
tensorflow-2.10.0 | 3.7-3.10 | GCC 9.3.1 | Bazel 5.1.1 | 8.1 | 11.2 |
tensorflow-2.9.0 | 3.7-3.10 | GCC 9.3.1 | Bazel 5.0.0 | 8.1 | 11.2 |
tensorflow-2.8.0 | 3.7-3.10 | GCC 7.3.1 | Bazel 4.2.1 | 8.1 | 11.2 |
tensorflow-2.7.0 | 3.7-3.9 | GCC 7.3.1 | Bazel 3.7.2 | 8.1 | 11.2 |
tensorflow-2.6.0 | 3.6-3.9 | GCC 7.3.1 | Bazel 3.7.2 | 8.1 | 11.2 |
tensorflow-2.5.0 | 3.6-3.9 | GCC 7.3.1 | Bazel 3.7.2 | 8.1 | 11.2 |
tensorflow-2.4.0 | 3.6-3.8 | GCC 7.3.1 | Bazel 3.1.0 | 8.0 | 11.0 |
tensorflow-2.3.0 | 3.5-3.8 | GCC 7.3.1 | Bazel 3.1.0 | 7.6 | 10.1 |
tensorflow-2.2.0 | 3.5-3.8 | GCC 7.3.1 | Bazel 2.0.0 | 7.6 | 10.1 |
tensorflow-2.1.0 | 2.7, 3.5-3.7 | GCC 7.3.1 | Bazel 0.27.1 | 7.6 | 10.1 |
tensorflow-2.0.0 | 2.7, 3.3-3.7 | GCC 7.3.1 | Bazel 0.26.1 | 7.4 | 10.0 |
tensorflow_gpu-1.15.0 | 2.7, 3.3-3.7 | GCC 7.3.1 | Bazel 0.26.1 | 7.4 | 10.0 |
tensorflow_gpu-1.14.0 | 2.7, 3.3-3.7 | GCC 4.8 | Bazel 0.24.1 | 7.4 | 10.0 |
tensorflow_gpu-1.13.1 | 2.7, 3.3-3.7 | GCC 4.8 | Bazel 0.19.2 | 7.4 | 10.0 |
tensorflow_gpu-1.12.0 | 2.7, 3.3-3.6 | GCC 4.8 | Bazel 0.15.0 | 7 | 9 |
tensorflow_gpu-1.11.0 | 2.7, 3.3-3.6 | GCC 4.8 | Bazel 0.15.0 | 7 | 9 |
tensorflow_gpu-1.10.0 | 2.7, 3.3-3.6 | GCC 4.8 | Bazel 0.15.0 | 7 | 9 |
tensorflow_gpu-1.9.0 | 2.7, 3.3-3.6 | GCC 4.8 | Bazel 0.11.0 | 7 | 9 |
tensorflow_gpu-1.8.0 | 2.7, 3.3-3.6 | GCC 4.8 | Bazel 0.10.0 | 7 | 9 |
tensorflow_gpu-1.7.0 | 2.7, 3.3-3.6 | GCC 4.8 | Bazel 0.9.0 | 7 | 9 |
tensorflow_gpu-1.6.0 | 2.7, 3.3-3.6 | GCC 4.8 | Bazel 0.9.0 | 7 | 9 |
tensorflow_gpu-1.5.0 | 2.7, 3.3-3.6 | GCC 4.8 | Bazel 0.8.0 | 7 | 9 |
tensorflow_gpu-1.4.0 | 2.7, 3.3-3.6 | GCC 4.8 | Bazel 0.5.4 | 6 | 8 |
tensorflow_gpu-1.3.0 | 2.7, 3.3-3.6 | GCC 4.8 | Bazel 0.4.5 | 6 | 8 |
tensorflow_gpu-1.2.0 | 2.7, 3.3-3.6 | GCC 4.8 | Bazel 0.4.5 | 5.1 | 8 |
tensorflow_gpu-1.1.0 | 2.7, 3.3-3.6 | GCC 4.8 | Bazel 0.4.2 | 5.1 | 8 |
tensorflow_gpu-1.0.0 | 2.7, 3.3-3.6 | GCC 4.8 | Bazel 0.4.2 | 5.1 | 8 |
macOS
CPU
Version | Python version | Compiler | Build tools |
---|---|---|---|
tensorflow-2.16.1 | 3.9-3.12 | Clang from Xcode 13.6 | Bazel 6.5.0 |
tensorflow-2.15.0 | 3.9-3.11 | Clang from xcode 10.15 | Bazel 6.1.0 |
tensorflow-2.14.0 | 3.9-3.11 | Clang from xcode 10.15 | Bazel 6.1.0 |
tensorflow-2.13.0 | 3.8-3.11 | Clang from xcode 10.15 | Bazel 5.3.0 |
tensorflow-2.12.0 | 3.8-3.11 | Clang from xcode 10.15 | Bazel 5.3.0 |
tensorflow-2.11.0 | 3.7-3.10 | Clang from xcode 10.14 | Bazel 5.3.0 |
tensorflow-2.10.0 | 3.7-3.10 | Clang from xcode 10.14 | Bazel 5.1.1 |
tensorflow-2.9.0 | 3.7-3.10 | Clang from xcode 10.14 | Bazel 5.0.0 |
tensorflow-2.8.0 | 3.7-3.10 | Clang from xcode 10.14 | Bazel 4.2.1 |
tensorflow-2.7.0 | 3.7-3.9 | Clang from xcode 10.11 | Bazel 3.7.2 |
tensorflow-2.6.0 | 3.6-3.9 | Clang from xcode 10.11 | Bazel 3.7.2 |
tensorflow-2.5.0 | 3.6-3.9 | Clang from xcode 10.11 | Bazel 3.7.2 |
tensorflow-2.4.0 | 3.6-3.8 | Clang from xcode 10.3 | Bazel 3.1.0 |
tensorflow-2.3.0 | 3.5-3.8 | Clang from xcode 10.1 | Bazel 3.1.0 |
tensorflow-2.2.0 | 3.5-3.8 | Clang from xcode 10.1 | Bazel 2.0.0 |
tensorflow-2.1.0 | 2.7, 3.5-3.7 | Clang from xcode 10.1 | Bazel 0.27.1 |
tensorflow-2.0.0 | 2.7, 3.5-3.7 | Clang from xcode 10.1 | Bazel 0.27.1 |
tensorflow-2.0.0 | 2.7, 3.3-3.7 | Clang from xcode 10.1 | Bazel 0.26.1 |
tensorflow-1.15.0 | 2.7, 3.3-3.7 | Clang from xcode 10.1 | Bazel 0.26.1 |
tensorflow-1.14.0 | 2.7, 3.3-3.7 | Clang from xcode | Bazel 0.24.1 |
tensorflow-1.13.1 | 2.7, 3.3-3.7 | Clang from xcode | Bazel 0.19.2 |
tensorflow-1.12.0 | 2.7, 3.3-3.6 | Clang from xcode | Bazel 0.15.0 |
tensorflow-1.11.0 | 2.7, 3.3-3.6 | Clang from xcode | Bazel 0.15.0 |
tensorflow-1.10.0 | 2.7, 3.3-3.6 | Clang from xcode | Bazel 0.15.0 |
tensorflow-1.9.0 | 2.7, 3.3-3.6 | Clang from xcode | Bazel 0.11.0 |
tensorflow-1.8.0 | 2.7, 3.3-3.6 | Clang from xcode | Bazel 0.10.1 |
tensorflow-1.7.0 | 2.7, 3.3-3.6 | Clang from xcode | Bazel 0.10.1 |
tensorflow-1.6.0 | 2.7, 3.3-3.6 | Clang from xcode | Bazel 0.8.1 |
tensorflow-1.5.0 | 2.7, 3.3-3.6 | Clang from xcode | Bazel 0.8.1 |
tensorflow-1.4.0 | 2.7, 3.3-3.6 | Clang from xcode | Bazel 0.5.4 |
tensorflow-1.3.0 | 2.7, 3.3-3.6 | Clang from xcode | Bazel 0.4.5 |
tensorflow-1.2.0 | 2.7, 3.3-3.6 | Clang from xcode | Bazel 0.4.5 |
tensorflow-1.1.0 | 2.7, 3.3-3.6 | Clang from xcode | Bazel 0.4.2 |
tensorflow-1.0.0 | 2.7, 3.3-3.6 | Clang from xcode | Bazel 0.4.2 |
GPU
Version | Python version | Compiler | Build tools | cuDNN | CUDA |
---|---|---|---|---|---|
tensorflow_gpu-1.1.0 | 2.7, 3.3-3.6 | Clang from xcode | Bazel 0.4.2 | 5.1 | 8 |
tensorflow_gpu-1.0.0 | 2.7, 3.3-3.6 | Clang from xcode | Bazel 0.4.2 | 5.1 | 8 |
★注意: 从 TF 2.11 开始,Windows平台不再支持 CUDA 构建。要在 Windows 上使用 TensorFlow GPU,您需要在 WSL2 中构建/安装 TensorFlow,或者使用 tensorflow-cpu 配合 TensorFlow-DirectML-Plugin。
经过测试的构建配置
Windows
CPU
Version | Python version | Compiler | Build tools |
---|---|---|---|
tensorflow-2.18.0 | 3.9-3.12 | CLANG 17.0.6 | Bazel 6.5.0 |
tensorflow-2.17.0 | 3.9-3.12 | CLANG 17.0.6 | Bazel 6.5.0 |
tensorflow-2.16.1 | 3.9-3.12 | CLANG 17.0.6 | Bazel 6.5.0 |
tensorflow-2.15.0 | 3.9-3.11 | MSVC 2019 | Bazel 6.1.0 |
tensorflow-2.14.0 | 3.9-3.11 | MSVC 2019 | Bazel 6.1.0 |
tensorflow-2.12.0 | 3.8-3.11 | MSVC 2019 | Bazel 5.3.0 |
tensorflow-2.11.0 | 3.7-3.10 | MSVC 2019 | Bazel 5.3.0 |
tensorflow-2.10.0 | 3.7-3.10 | MSVC 2019 | Bazel 5.1.1 |
tensorflow-2.9.0 | 3.7-3.10 | MSVC 2019 | Bazel 5.0.0 |
tensorflow-2.8.0 | 3.7-3.10 | MSVC 2019 | Bazel 4.2.1 |
tensorflow-2.7.0 | 3.7-3.9 | MSVC 2019 | Bazel 3.7.2 |
tensorflow-2.6.0 | 3.6-3.9 | MSVC 2019 | Bazel 3.7.2 |
tensorflow-2.5.0 | 3.6-3.9 | MSVC 2019 | Bazel 3.7.2 |
tensorflow-2.4.0 | 3.6-3.8 | MSVC 2019 | Bazel 3.1.0 |
tensorflow-2.3.0 | 3.5-3.8 | MSVC 2019 | Bazel 3.1.0 |
tensorflow-2.2.0 | 3.5-3.8 | MSVC 2019 | Bazel 2.0.0 |
tensorflow-2.1.0 | 3.5-3.7 | MSVC 2019 | Bazel 0.27.1-0.29.1 |
tensorflow-2.0.0 | 3.5-3.7 | MSVC 2017 | Bazel 0.26.1 |
tensorflow-1.15.0 | 3.5-3.7 | MSVC 2017 | Bazel 0.26.1 |
tensorflow-1.14.0 | 3.5-3.7 | MSVC 2017 | Bazel 0.24.1-0.25.2 |
tensorflow-1.13.0 | 3.5-3.7 | MSVC 2015 update 3 | Bazel 0.19.0-0.21.0 |
tensorflow-1.12.0 | 3.5-3.6 | MSVC 2015 update 3 | Bazel 0.15.0 |
tensorflow-1.11.0 | 3.5-3.6 | MSVC 2015 update 3 | Bazel 0.15.0 |
tensorflow-1.10.0 | 3.5-3.6 | MSVC 2015 update 3 | Cmake v3.6.3 |
tensorflow-1.9.0 | 3.5-3.6 | MSVC 2015 update 3 | Cmake v3.6.3 |
tensorflow-1.8.0 | 3.5-3.6 | MSVC 2015 update 3 | Cmake v3.6.3 |
tensorflow-1.7.0 | 3.5-3.6 | MSVC 2015 update 3 | Cmake v3.6.3 |
tensorflow-1.6.0 | 3.5-3.6 | MSVC 2015 update 3 | Cmake v3.6.3 |
tensorflow-1.5.0 | 3.5-3.6 | MSVC 2015 update 3 | Cmake v3.6.3 |
tensorflow-1.4.0 | 3.5-3.6 | MSVC 2015 update 3 | Cmake v3.6.3 |
tensorflow-1.3.0 | 3.5-3.6 | MSVC 2015 update 3 | Cmake v3.6.3 |
tensorflow-1.2.0 | 3.5-3.6 | MSVC 2015 update 3 | Cmake v3.6.3 |
tensorflow-1.1.0 | 3.5 | MSVC 2015 update 3 | Cmake v3.6.3 |
tensorflow-1.0.0 | 3.5 | MSVC 2015 update 3 | Cmake v3.6.3 |
GPU
★**注意:**原生 Windows 上的 GPU 支持仅适用于 2.10 或更早版本,从 TF 2.11 开始,Windows 不支持 CUDA 构建。要在 Windows 上使用 TensorFlow GPU,您需要在 WSL2 中构建/安装 TensorFlow,或者使用 tensorflow-cpu 配合 TensorFlow-DirectML-Plugin。
Version | Python version | Compiler | Build tools | cuDNN | CUDA |
---|---|---|---|---|---|
tensorflow_gpu-2.10.0 | 3.7-3.10 | MSVC 2019 | Bazel 5.1.1 | 8.1 | 11.2 |
tensorflow_gpu-2.9.0 | 3.7-3.10 | MSVC 2019 | Bazel 5.0.0 | 8.1 | 11.2 |
tensorflow_gpu-2.8.0 | 3.7-3.10 | MSVC 2019 | Bazel 4.2.1 | 8.1 | 11.2 |
tensorflow_gpu-2.7.0 | 3.7-3.9 | MSVC 2019 | Bazel 3.7.2 | 8.1 | 11.2 |
tensorflow_gpu-2.6.0 | 3.6-3.9 | MSVC 2019 | Bazel 3.7.2 | 8.1 | 11.2 |
tensorflow_gpu-2.5.0 | 3.6-3.9 | MSVC 2019 | Bazel 3.7.2 | 8.1 | 11.2 |
tensorflow_gpu-2.4.0 | 3.6-3.8 | MSVC 2019 | Bazel 3.1.0 | 8.0 | 11.0 |
tensorflow_gpu-2.3.0 | 3.5-3.8 | MSVC 2019 | Bazel 3.1.0 | 7.6 | 10.1 |
tensorflow_gpu-2.2.0 | 3.5-3.8 | MSVC 2019 | Bazel 2.0.0 | 7.6 | 10.1 |
tensorflow_gpu-2.1.0 | 3.5-3.7 | MSVC 2019 | Bazel 0.27.1-0.29.1 | 7.6 | 10.1 |
tensorflow_gpu-2.0.0 | 3.5-3.7 | MSVC 2017 | Bazel 0.26.1 | 7.4 | 10 |
tensorflow_gpu-1.15.0 | 3.5-3.7 | MSVC 2017 | Bazel 0.26.1 | 7.4 | 10 |
tensorflow_gpu-1.14.0 | 3.5-3.7 | MSVC 2017 | Bazel 0.24.1-0.25.2 | 7.4 | 10 |
tensorflow_gpu-1.13.0 | 3.5-3.7 | MSVC 2015 update 3 | Bazel 0.19.0-0.21.0 | 7.4 | 10 |
tensorflow_gpu-1.12.0 | 3.5-3.6 | MSVC 2015 update 3 | Bazel 0.15.0 | 7.2 | 9.0 |
tensorflow_gpu-1.11.0 | 3.5-3.6 | MSVC 2015 update 3 | Bazel 0.15.0 | 7 | 9 |
tensorflow_gpu-1.10.0 | 3.5-3.6 | MSVC 2015 update 3 | Cmake v3.6.3 | 7 | 9 |
tensorflow_gpu-1.9.0 | 3.5-3.6 | MSVC 2015 update 3 | Cmake v3.6.3 | 7 | 9 |
tensorflow_gpu-1.8.0 | 3.5-3.6 | MSVC 2015 update 3 | Cmake v3.6.3 | 7 | 9 |
tensorflow_gpu-1.7.0 | 3.5-3.6 | MSVC 2015 update 3 | Cmake v3.6.3 | 7 | 9 |
tensorflow_gpu-1.6.0 | 3.5-3.6 | MSVC 2015 update 3 | Cmake v3.6.3 | 7 | 9 |
tensorflow_gpu-1.5.0 | 3.5-3.6 | MSVC 2015 update 3 | Cmake v3.6.3 | 7 | 9 |
tensorflow_gpu-1.4.0 | 3.5-3.6 | MSVC 2015 update 3 | Cmake v3.6.3 | 6 | 8 |
tensorflow_gpu-1.3.0 | 3.5-3.6 | MSVC 2015 update 3 | Cmake v3.6.3 | 6 | 8 |
tensorflow_gpu-1.2.0 | 3.5-3.6 | MSVC 2015 update 3 | Cmake v3.6.3 | 5.1 | 8 |
tensorflow_gpu-1.1.0 | 3.5 | MSVC 2015 update 3 | Cmake v3.6.3 | 5.1 | 8 |
tensorflow_gpu-1.0.0 | 3.5 | MSVC 2015 update 3 | Cmake v3.6.3 | 5.1 | 8 |
2. 第三方验证配置
2.1 官方TensorFlow
贴几个官网没有的配置表
Version | Python version | Compiler | Build tools | cuDNN | CUDA |
---|---|---|---|---|---|
tensorflow-2.9 | 3.8 | 8.2.1 | 11.3.1 | ||
tensorflow-gpu-2.0.0 | 3.7 | 7.6.5(亲测) | 10.0.130 | ||
tensorflow-gpu==2.0.0-alpha0 | 7.5.1 | 10.0 | |||
tensorflow_gpu-1.15.0 | 3.7.11 | 7.6.0 | 10.0.130 | ||
tensorflow_gpu-1.15.0 | 3.7.12 | 7.6.5.32 | 10.0.130 |
上面的小版本号个人认为可以忽略不计,可以理解为下表的示例内容,需要注意的是TF1.x已经停止更新故对新硬件(主要是RTX30系列之后的显卡)不支持,故需要使用Nvidia-TensorFlow代替官方版本。
Version | Python version | Compiler | Build tools | cuDNN | CUDA |
---|---|---|---|---|---|
tensorflow_gpu-1.15.0 | 3.7 | 7.6 | 10.0 |
2.2 Nvidia-TensorFlow
windows 安装方法
人工智能
9 篇文章12 订阅
订阅专栏
目录
前言
一、安装python(也可以用conda安装)
二、安装VS的C++环境
三、安装CUDA
2.1、检查环境
2.2、 查看自己是否有NVIDA显卡驱动程序
2.3、查看GPU显卡所支持的CUDA版本
2.4、安装对应版本的CUDA安装包
2.5、选择对应的系统
2.6、运行安装包
2.7、配置Cuda的环境变量
2.8、查看是CUDA是否安装成功
2.9、验证deviceQuery和bandwidthTest
四、安装pytorch
五、运行效果
前言
一年前,安装过cuda,觉得并不难,就没有记录。
这次安装还算顺利,就是在找资料的时候,浪费了不少时间
这次就记录下来,方便以后再次安装
总结安装程序:
1、安装python环境
2、安装VS的C++环境(因为CUDA在安装时,需要VS的里面的工具包来编译。)
3、安装cuda
4、安装pytorch
一、安装python(也可以用conda安装)
直接官网下载:
Python Releases for Windows | Python.org
The official home of the Python Programming Language
https://www.python.org/downloads/windows/
我下载的版本------蓝奏云下载(python3.9.5):python-3.9.5-amd64.zip - 蓝奏云
进入命令行,输入python,出现这样的界面则表示成功安装
使用conda(Anaconda)的话,可以看看b站的教程(这里就不赘述了)
二、安装VS的C++环境
如果你想用其他版本可以去官网下载:
Downloads & Keys - Visual Studio Subscriptions
https://my.visualstudio.com/Downloads?q=Visual Studio 2022
我下载的是:社区免费版VS 2022------VisualStudioSetup.exe
蓝奏云下载2022社区免费版:https://wwm.lanzout.com/i7xQY1ods8xi
密码:6epa
运行安装程序:
然后找到C++桌面开发
建议安装到专门放软件的盘,不要安装到系统盘C,然后点击开始进行安装
安装完后,电脑需要重启,重启后就可以使用了
三、安装CUDA
在安装前,可以先看看这个博客:
理清GPU、CUDA、CUDA Toolkit、cuDNN关系以及下载安装_cudatoolkit-CSDN博客
https://blog.csdn.net/qq_42406643/article/details/109545766
2.1、检查环境
检查是否有NVIDA的独立显卡,前面的VS是否已经安装
2.2、 查看自己是否有NVIDA显卡驱动程序
如果没有显卡的控制面板,下载安装:NVIDIA GeForce 驱动程序 - N 卡驱动 | NVIDIA
2.3、查看GPU显卡所支持的CUDA版本
控制面板-> 帮助-> 系统信息-> 组件-> 我的是CUDA 12.3
2.4、安装对应版本的CUDA安装包
进入官网:CUDA Toolkit Archive | NVIDIA Developer
2.5、选择对应的系统
如果用离线版本,就有3个G,这里我选择的是在线安装
2.6、运行安装包
自己选择路径:
选择------自定义安装
安装组件,全部勾选,点击下一步
自定义下载路径
建议安装到专门放软件的盘,不要安装到系统盘C
然后慢慢等
之后一直下一步就行了~
2.7、配置Cuda的环境变量
安装完成后,就需要我们配置Cuda的环境变量了
他会自己添加的变量:
先找到我们自定义安装的cuda文件夹
然后添加两个环境变量
相当于,总共有这4个文件夹的~
2.8、查看是CUDA是否安装成功
Win + R 打开cmd ,输入命令:nvcc --version
2.9、验证deviceQuery和bandwidthTest
在命令窗口运行文件
ok!CUDA搞定啦~
四、安装pytorch
我的电脑的cuda版本是12.3的,准备安装pytorch!
目前,官网上没有直接支持cuda 12.3的pytorch版本!
通过翻阅其他博客,博主说cuda是向下兼容的!
我就选择了CUDA 12.1
4.1、通过官网,选择对应版本,然后复制命令,直接下载即可!
不过在这里先pip换源
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
pip config set install.trusted-host mirrors.aliyun.com
同时,再设置一下超时时间,毕竟这个torch有2~3个G(这里就不赘述了,直接放链接,如果超时了,再来设置也行~)
Python------记录pip问题(解决下载慢、升级失败问题)_pip下载太慢-CSDN博客
https://blog.csdn.net/Pan_peter/article/details/129553679
安装完成~
五、运行效果
我把我之前那个项目拿来,跑一下试试~
基于YOLOv8的多端车流检测系统(用于毕设+开源)_yolov8 rtsp-CSDN博客
https://blog.csdn.net/Pan_peter/article/details/132048923
先下载其他库
报错了:type object 'Detections' has no attribute 'from_yolov8'
大佬评论:由于Detection删除了from,所以需要降级,又因为前面的sv调用,所以把supervision降级为0.6.0即可解决pip install supervision==0.6.0
感谢大佬!!!
运行项目:(20多帧,比俺之前只有几帧好多了,啊哈哈~)
用之前的训练demo包试试:
windows使用YOLOv8训练自己的模型(0基础保姆级教学)_windows10使用yolov8常见问题-CSDN博客
https://blog.csdn.net/Pan_peter/article/details/129907710
也可以正常训练
只不过这里遇到了一个小插曲:
报错:RuntimeError: DataLoader worker (pid(s) 20580, 22560, 5668, 18512, 1240, 18208, 22356) exited unexpectedly
他搞了多线程,我直接关闭他,把训练代码改为 workers=0
model.train(data='./data/cat.yaml', epochs=100, imgsz=640, workers=0)
pytorch与cuda版本对应关系汇总
pytorch与cuda版本关系
cuda版本 支持pytorch版本
cuda10.2 1.5 ~ 1.12
cuda11.0 1.7 ~ 1.7.1
cuda11.1 1.8 ~ 1.10.1
cuda11.3 1.8.1 ~ 1.12.1
cuda11.6 1.12.0 ~ 1.13.1
cuda11.7 1.13.0 ~ 2.0.1
cuda11.8 2.0.0 ~ 2.1.1
cuda12.1 2.1.0 ~ 2.1.1
cuda 与 cudnn关系
cuda版本 支持cudnn版本
cuda10.2 v7.6.5 ~ v8.7.0
cuda11.3 v8.2.0 ~ v8.9.6
pytorch 与 python关系
torch torchvision Python
main / nightly main / nightly >=3.8, <=3.11
2.0 0.15 >=3.8, <=3.11
1.13 0.14 >=3.7.2, <=3.10
1.12 0.13 >=3.7, <=3.10
1.11 0.12 >=3.7, <=3.10
1.10 0.11 >=3.6, <=3.9
1.9 0.10 >=3.6, <=3.9
1.8 0.9 >=3.6, <=3.9
1.7 0.8 >=3.6, <=3.9
1.6 0.7 >=3.6, <=3.8
1.5 0.6 >=3.5, <=3.8
1.4 0.5 ==2.7, >=3.5, <=3.8
1.3 0.4.2 / 0.4.3 ==2.7, >=3.5, <=3.7
1.2 0.4.1 ==2.7, >=3.5, <=3.7
1.1 0.3 ==2.7, >=3.5, <=3.7
<=1.0 0.2 ==2.7, >=3.5, <=3.7
安装torch 支持cuda的版本
先开始去官网PyTorch
用这个官网的命令下,一直会把cpu版本的一起下下来,导致运行的时候一直cpu版本而不是gpu版本,torch.cuda.is_available()这个是false,问题很大。
重新去搜了个命令:pip install torch==1.8.0+cu111 torchvision==0.9.0+cu111 torchaudio==0.8.0 -f https://download.pytorch.org/whl/torch_stable.html
paddlepadlle和cuda的对应关系
Download cuDNN v8.1.1 (Feburary 26th, 2021), for CUDA 11.0,11.1 and 11.2
Download cuDNN v8.1.1 [Feburary 26th, 2021), for CUDA 10.2
Download cuDNN v8.1.0 [January 26th, 2021). for CUDA 11.0.11.1 and 11.2
Download cuDNN v8.1.0 (January 26th, 2021), for CUDA 10.2
Download cuDNN v8.0.5 [November 9th, 2020), for CUDA 11.1
Download cuDNNv8.0.5 (November 9th,2020).for CUDA 11.0
Download cuDNN v8.0.5 (November 9th, 2020),for CUDA 10.2
Download cuDNN v8.0.5 [November 9th, 2020).for CUDA 10.1
Download cuDNN v8.0.4 [September 28th,2020).for CUDA 11.1
Download cuDNN v8.0.4 [September 28th, 2020),for CUDA 11.0
Download cuDNN v8.0.4 [September 28th,2020).for CUDA 10.2
Download cuDNN v8.0.4 [September 28th, 2020].for CUDA 10.1
Download cuDNN v8.0.3 (August 26th,2020).for CUDA 11.0
Download cuDNN v8.0.3 [August 26th,2020).for CUDA 10.2
Download cuDNN v8.0.3 (August 26th,2020),for CUDA 10.1
Download cuDNN v8.0.2[Juty 24th,2020), for CUDA 11.0
Download cuDNN v8.0.2 [July 24th,2020),for CUDA 10.2
Download cuDNN v8.0.2 [July 24th,2020),for CUDA 10.1
Download cuDNN v8.0.1 RC2 [June 26th,2020), for CUDA 11.0
Download cuDNN v8.0.1 RC2 (June 26th,2020).for CUDA 10.2
Download cuDNN v7.6.5 [November 18th, 2019]. for CUDA 10.2
Download cuDNN v7.6.5 (November 5th, 2019).for CUDA 10.1
Download cuDNN v7.6.5 (November 5th, 2019),for CUDA 10.0
Download cuDNN v7.6.5 [November 5th, 2019]. for CUDA 9.2
Download cuDNN v7.6.5 [November 5th,2019), for CUDA 9.0
Download cuDNN v7.6.4 (September 27,2019), for CUDA 10.1
Download cuDNN v7.6.4 [September 27,2019). for CUDA 10.0
Download cuDNN v7.6.4 (September 27.2019]. for CUDA 9.2
Download cuDNN v7.6.4 [September 27, 2019), for CUDA 9.0
Download cuDNN v7.6.3 (August 23, 2019).for CUDA 10.1
Download cuDNN v7.6.3 [August 23,2019].for CUDA 10.0
Download cuDNN v7.6.3 (August 23,2019). for CUDA 9.2
Download cuDNN v7.6.3 [August 23,2019).for CUDA 9.0
Download cuDNN v7.6.2 [July 22,2019). for CUDA 10.1
paddlepaddle-gpu==X.X.X.postXX 其中post后的两个XX分别代表CUDA版本,CUDNN版本。
paddlepaddle-gpu==1.5.1.post87 代表CUDA版本8,CUDNN版本7.X
paddlepaddle-gpu==1.5.1.post97 代表CUDA版本9,CUDNN版本7.X
paddlepaddle-gpu==1.5.1.post107 代表CUDA版本10,CUDNN版本7.X
paddlepaddle2.52 ==>cuda11.8
paddlepaddle2.62 ==>cuda12.4
python=3.7 paddlepaddle-gpu =2.4 cuda =11.7 cudnn=8.4.1
paddlepaddle-gpu2.3、cuda10.2、cudnn7.6.5。