导入torch.utils.tensorboard会导致tensorflow警告

问题描述 投票:0回答:1

here所述,tensorboard是tensorflow的一部分,但并不依赖于它。可以在 pytorch 中使用它,例如

from torch.utils.tensorboard import SummaryWriter

然而,令人烦恼的是,这种导入会导致一长串与张量流相关的警告

2024-03-28 12:11:43.296359: I tensorflow/core/util/port.cc:110] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable `TF_ENABLE_ONEDNN_OPTS=0`.                                                                              
2024-03-28 12:11:43.331928: I tensorflow/core/platform/cpu_feature_guard.cc:182] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.
To enable the following instructions: AVX2 AVX512F AVX512_VNNI FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.
2024-03-28 12:11:43.970865: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT

我想知道这是否有必要和/或如何(安全地?)静音。

python pytorch tensorboard
1个回答
0
投票

我找到了一个不基于导入tensorflow(我不使用)的解决方案,但允许通过环境变量静音

只需将此行添加到脚本的开头即可。

os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3' # FATAL
这应该适用于任何

tensorflow > 1.14


    

© www.soinside.com 2019 - 2024. All rights reserved.