conda create -n tfg python=3.8
conda activate tfg
pip install tensorflow-gpu==2.6.0
conda install cudatoolkit==11.3.1 cudnn==8.2.1
检验
python
import tensorflow as tf
print('GPU:',tf.test.is_gpu_available())
显示
GPU True
成功
conda create -n tfg python=3.8
conda activate tfg
pip install tensorflow-gpu==2.6.0
conda install cudatoolkit==11.3.1 cudnn==8.2.1
检验
python
import tensorflow as tf
print('GPU:',tf.test.is_gpu_available())
显示
GPU True
成功