zoukankan      html  css  js  c++  java
  • 关掉 TensorFlow 的调试信息

    TensorFlow 每次运行的时候都会弹出类似下面的调度信息

    I tensorflow/stream_executor/dso_loader.cc:105] successfully opened CUDA library libcublas.so locally
    I tensorflow/stream_executor/dso_loader.cc:105] successfully opened CUDA library libcudnn.so locally
    I tensorflow/stream_executor/dso_loader.cc:105] successfully opened CUDA library libcufft.so locally
    I tensorflow/stream_executor/dso_loader.cc:105] successfully opened CUDA library libcuda.so.1 locally
    I tensorflow/stream_executor/dso_loader.cc:105] successfully opened CUDA library libcurand.so locally
    I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:900] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
    I tensorflow/core/common_runtime/gpu/gpu_init.cc:102] Found device 0 with properties: 
    name: Graphics Device
    major: 5 minor: 2 memoryClockRate (GHz) 1.0885
    pciBusID 0000:04:00.0
    Total memory: 12.00GiB
    Free memory: 11.83GiB
    I tensorflow/core/common_runtime/gpu/gpu_init.cc:126] DMA: 0 
    I tensorflow/core/common_runtime/gpu/gpu_init.cc:136] 0:   Y 
    I tensorflow/core/common_runtime/gpu/gpu_device.cc:717] Creating TensorFlow device (/gpu:0) -> (device: 0, name: Graphics Device, pci bus id: 0000:04:00.0)
    I tensorflow/core/common_runtime/gpu/gpu_bfc_allocator.cc:51] Creating bin of max chunk size 1.0KiB
    

    如果不想要这些调度信息,可以设置不同等级的TF_CPP_MIN_LOG_LEVEL

      Level | Level for Humans | Level Description                  
     -------|------------------|------------------------------------ 
      0     | DEBUG            | [Default] Print all messages       
      1     | INFO             | Filter out INFO messages           
      2     | WARNING          | Filter out INFO & WARNING messages 
      3     | ERROR            | Filter out all messages      
    

    TF_CPP_MIN_LOG_LEVEL设置为3

    import os
    os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'  # or any {'0', '1', '2'}
    import tensorflow as tf
    
  • 相关阅读:
    【Luogu】P2491消防(单调队列)
    【Luogu】P2824排序(二分答案+线段树排序)
    2-k8s笔记-Kubernetes安装配置指南
    1-k8s笔记-Kubernetes入门
    22-MySQL DBA笔记-其他产品的选择
    21-MySQL DBA笔记-高可用性
    20-MySQL DBA笔记-可扩展的架构
    19-MySQL DBA笔记-操作系统、硬件、网络的优化
    18-MySQL DBA笔记-MySQL Server调优
    17-MySQL DBA笔记-应用程序调优
  • 原文地址:https://www.cnblogs.com/yaos/p/14021265.html
Copyright © 2011-2022 走看看