简体   繁体   English

如何抑制这些警告

[英]How to suppress these warnings

after some google, i find this code, but it does not work.经过一些谷歌,我找到了这段代码,但它不起作用。

warnings.filterwarnings("ignore")

The following still display the warning messages as below以下仍然显示警告消息如下

2021-05-27 22:04:57.755845: 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-05-27 22:04:57.756056: 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-05-27 22:05:39.988042: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'nvcuda.dll'; dlerror: nvcuda.dll not found
2021-05-27 22:05:39.988241: W tensorflow/stream_executor/cuda/cuda_driver.cc:326] failed call to cuInit: UNKNOWN ERROR (303)
2021-05-27 22:05:39.996417: I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:169] retrieving CUDA diagnostic information for host: (machine name)
2021-05-27 22:05:39.996655: I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:176] hostname: (username)
2021-05-27 22:05:39.997423: 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
To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.

2021-05-27 22:05:40.926604: I tensorflow/compiler/mlir/mlir_graph_optimization_pass.cc:176] None of the MLIR Optimization Passes are enabled (registered 2)

Any suggestion would be appreciated任何建议将不胜感激

The following workaround will stop showing the Tensorflow warnings以下解决方法将停止显示 Tensorflow 警告

import tensorflow as tf
tf.logging.set_verbosity(tf.logging.ERROR)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM