Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

tensorflow: Not creating XLA devices, tf_xla_enable_xla_devices not set

I run drive.py program from Code Project | A Complete guide to self driving car

but when i start program i have error:

Not creating XLA devices, tf_xla_enable_xla_devices not set

Does anyone know how I can fix this problem? What should I download or reinstall?

I use:

Python 3.8.7

CUDA 11.0

tensorflow 2.4.1 On http://0.0.0.0:4567/ of course I see nothing

enter image description here

like image 942
Cierniostwor Avatar asked Jan 26 '21 18:01

Cierniostwor


People also ask

What does not creating XLA devices not set mean?

Not creating XLA devices, tf_xla_enable_xla_devices not set message is an information log which you can ignore. Sorry, something went wrong. The Not creating XLA devices, tf_xla_enable_xla_devices not set message is an information log which you can safely ignore. Thanks!

What is XLA in TensorFlow?

XLA:CPU is described as providing access to the CPU while the GPU is executing the code for modeling Tensorflow. The XLA functionality, when its environmental variable is set, allows the CPU to "help out" at specific, critical performance stages and thus to accelerate the processes one might usually think the GPU is needed for.

How to enable XLA devices on the GPU?

Alternatively, one can set the environment variable in Windows system settings: TF_XLA_FLAGS = --tf_xla_enable_xla_devices. According to this discussion, this helps use the GPU much more efficiently than simply ignoring the info. Usually this message should not interfere. to check that they are detected.

What is TF_XLA_enable_XLA_devices not set?

Not creating XLA devices, tf_xla_enable_xla_devices not set message is an information log which you can ignore. Sorry, something went wrong. The Not creating XLA devices, tf_xla_enable_xla_devices not set message is an information log which you can safely ignore.


3 Answers

Please add the following at the very beginning of your script:

os.environ['TF_XLA_FLAGS'] = '--tf_xla_enable_xla_devices'
like image 90
diman82 Avatar answered Oct 16 '22 17:10

diman82


Alternatively, one can set the environment variable in Windows system settings: TF_XLA_FLAGS = --tf_xla_enable_xla_devices.

According to this discussion, this helps use the GPU much more efficiently than simply ignoring the info.

like image 44
Jianyu Avatar answered Oct 16 '22 16:10

Jianyu


Usually this message should not interfere.

Please try

import tensorflow as tf
print("GPUs: ", len(tf.config.experimental.list_physical_devices('GPU')))

to check that they are detected.

If you need it, please check the release notes at github:

XLA:CPU and XLA:GPU devices are no longer registered by default. Use TF_XLA_FLAGS=--tf_xla_enable_xla_devices if you really need them, but this flag will eventually be removed in subsequent releases.

like image 30
MCL Avatar answered Oct 16 '22 16:10

MCL