环境配置:Win10 cuda11.0 cudnn8.0 Python3.7 tensorflow2.4.0
运行代码报错:
Not creating XLA devices, tf_xla_enable_xla_devices not set
解决方法:
在主程序开头的 import os 后添加
os.environ['TF_XLA_FLAGS'] = '--tf_xla_enable_xla_devices'
Not creating XLA devices, tf_xla_enable_xla_devices not set
os.environ['TF_XLA_FLAGS'] = '--tf_xla_enable_xla_devices'