Not creating XLA devices, tf_xla_enable_xla_devices not set已解决

环境配置: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'

形如:

 问题解决

猜你喜欢

转载自blog.csdn.net/Nan_Feng_ya/article/details/130515486
今日推荐