'Is it there something wrong with tensorflow?

Hello I have being using tensorflow and keras for a while. I use this packages to build neural networks. As I work on CPU I was used to recive a message like this one:

Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX AVX2

But now, after updating the packages I am getting the following warnings:

2021-08-27 18:48:09.068353: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'cudart64_110.dll'; dlerror: cudart64_110.dll not found

2021-08-27 18:48:09.069154: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine.

2021-08-27 18:48:46.432183: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'nvcuda.dll'; dlerror: nvcuda.dll not found

2021-08-27 18:48:46.432971: W tensorflow/stream_executor/cuda/cuda_driver.cc:269] failed call to cuInit: UNKNOWN ERROR (303)

2021-08-27 18:48:46.433910: I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:169] retrieving CUDA diagnostic information for host: LAPTOP-RR404INI

2021-08-27 18:48:46.434837: I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:176] hostname: LAPTOP-RR404INI

2021-08-27 18:48:46.436222: I tensorflow/core/platform/cpu_feature_guard.cc:142] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN) to use the following CPU instructions in performance-critical operations: AVX AVX2

To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.

Tensorflow works as expected, so I will like to now if these waranings are a problem and if they are how do I fixed it?

I have tried to fix the by uninstalling and intalling everything again using the following code from the issue Installation of Keras and TensorFlow in R #1136 but I get the warnings anyway:

install.packages("remotes")
remotes::install_github(paste0("rstudio/", c("reticulate", "tensorflow", "keras")))
reticulate::install_miniconda() 
keras::install_keras()


Solution 1:[1]

You are seeing the warnings because the default tensorflow package is capable of taking advantage of a GPU device. When it is initialized, it looks for a GPU device + GPU drivers, and if it can't find them, it issues the warnings you see. If you don't have a GPU, or don't want tensorflow to use a GPU, they are safe to ignore.

If you find the warnings particularly annoying, you can install a CPU only version of tensorflow with:

keras::install_keras(tensorflow="cpu")

Or you can silence the warning by setting this environment variable before loading tensorflow:

Sys.setenv("TF_CPP_MIN_LOG_LEVEL"="2")
  # 0 = all messages are logged (default behavior)
  # 1 = INFO messages are not printed
  # 2 = INFO and WARNING messages are not printed
  # 3 = INFO, WARNING, and ERROR messages are not printed

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1