繁体   English   中英

Tensorflow 每次导入时都会发出警告 - 'cudart64_101.dll not found'。 有没有办法摆脱这个警告?

[英]Tensorflow Warning every time I import it - 'cudart64_101.dll not found'. Is there a way to get rid of only this warning?

2021-01-26 17:13:35.314383: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'cudart64_101.dll'; dlerror: cudart64_101.dll not found
2021-01-26 17:13:35.321533: 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.

发生这种情况时,代码的执行往往会暂停一段时间。 有针对这个的解决方法吗?

如果您正在使用 Tensorflow 2.0,设置TF_CPP_MIN_LOG_LEVEL应该仍然有效

您可以使用 os.environ 禁用所有日志:

import os
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3' 
import tensorflow as tf

这里,

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

(以上是在 TensorFlow 0.12 和 1.0 上测试的)

暂无
暂无

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

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