tensorflow / quantum

Hybrid Quantum-Classical Machine Learning in TensorFlow
https://www.tensorflow.org/quantum
Apache License 2.0
1.79k stars 572 forks source link

Warning while importing `tensorflow-quantum` framework. #730

Closed Shuhul24 closed 1 year ago

Shuhul24 commented 1 year ago

When I am importing tensorflow-quantum library, I get the following warning/error.

2022-12-06 10:55:05.047219: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libcuda.so.1'; dlerror: libcuda.so.1: cannot open shared object file: No such file or directory; LD_LIBRARY_PATH: :/home/shuhul.handoo/anaconda3/lib/
2022-12-06 10:55:05.060630: W tensorflow/stream_executor/cuda/cuda_driver.cc:269] failed call to cuInit: UNKNOWN ERROR (303)
2022-12-06 10:55:05.060763: I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:156] kernel driver does not appear to be running on this host (login4.iitbhu.ac.in): /proc/driver/nvidia/version does not exist
2022-12-06 10:55:05.228845: I tensorflow/core/platform/cpu_feature_guard.cc:151] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN) to use the following CPU instructions in performance-critical operations:  AVX2 AVX512F FMA
To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.

Although the code runs, yet this error/warning occurs. What should be done in order to avoid this?

lockwo commented 1 year ago
import os
import warnings

warnings.filterwarnings("ignore")
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3' 

Should fix most aesthetic warning problems.

Shuhul24 commented 1 year ago

Thanks! That worked for me.