当前位置: 代码迷 >> 综合 >> Windows TensorFlow c++版本 Not creating XLA devices, tf_xla_enable_xla_devices not set
  详细解决方案

Windows TensorFlow c++版本 Not creating XLA devices, tf_xla_enable_xla_devices not set

热度:35   发布时间:2023-12-21 12:27:25.0

主机环境:

1、CUDA 11.0

2、cuDNN 8.0

3、TensorFlow 2.41

4、VS 2019

根据项目需求编译C++版本的TensorFlow,首先参考官网提供的测试通过的编译环境,根据自己机器的配置,选择如上编译环境,具体可参考下图:

然后按照官网教程结合下列教程:

https://medium.com/vitrox-publication/deep-learning-frameworks-tensorflow-build-from-source-on-windows-python-c-cpu-gpu-d3aa4d0772d8)编译,期间因为大家都懂的网络问题导致下载失败以外,其他基本一次编译通过。

然后进行C++调用测试,出现下述错误:

解决办法:

参照python版本的解决办法,添加环境变量:

TF_XLA_FLAGS

--tf_xla_enable_xla_devices

重新运行程序即可!

 

  相关解决方案