声明版本:
python版本--3.7.6
cuda版本--11.4.0
cudnn版本--8.2
tensorflow-gpu版本--2.4.0
①解决Not creating XLA devices, tf_xla_enable_xla_devices not set:
在import tensorflow后加(如果不加会报错,则每次都要加)
import os
os.environ['TF_XLA_FLAGS'] = '--tf_xla_enable_xla_devices'
②解决Could not load dynamic library 'cusolver64_10.dll'; dlerror: cusolver64_10.dll not found
将C:Program FilesNVIDIA GPU Computing ToolkitCUDAv11.4bin中的cusolver64_11.dll更名为cusolver64_10.dll
③导入tensorflow测试是否成功
import tensorflow as tf
tf.test.is_gpu_available()