-
python 3.10.18
-
cudatoolkit:11.2.2
-
cudnn: 8.1.0
-
numpy: 1.23.5
-
conda install cudatoolkit=11.2 cudnn=8.1.0 -c conda-forge
-
python -m pip install tensorflow==2.10
不要装 tensorflow-gpu,改装 tensorflow==2.10.*
tensorflow-gpu 这个包在新版本 TensorFlow 里基本已经"废弃/不再需要"了(GPU 支持已经合并进 tensorflow 主包),用 pip 装 tensorflow-gpu==2.10 会被依赖链(尤其是 grpcio)卡死,出现 "No matching distribution found"。
- pip install -i https://pypi.tuna.tsinghua.edu.cn/simple tensorflow==2.10.*
-pip uninstall -y numpy - pip install "numpy==1.23.5"
未尝试可行的
bash
conda create -n tf210 python=3.10 -y
conda activate tf210
python -m pip install --upgrade pip
conda install cudatoolkit=11.2 cudnn=8.1.0 -c conda-forge
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple "numpy==1.23.5" "protobuf<4" "tensorflow==2.10.*"
python -c "import tensorflow as tf; print(tf.__version__)"