• TensorFlow忽略警告信息:FutureWarning


    最近执行Tensorflow程序出现如下警告信息

    D:python36libsite-packages	ensorflowpythonframeworkdtypes.py:493: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
      _np_qint8 = np.dtype([("qint8", np.int8, 1)])
    D:python36libsite-packages	ensorflowpythonframeworkdtypes.py:494: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
      _np_quint8 = np.dtype([("quint8", np.uint8, 1)])
    D:python36libsite-packages	ensorflowpythonframeworkdtypes.py:495: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
      _np_qint16 = np.dtype([("qint16", np.int16, 1)])
    D:python36libsite-packages	ensorflowpythonframeworkdtypes.py:496: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
      _np_quint16 = np.dtype([("quint16", np.uint16, 1)])
    D:python36libsite-packages	ensorflowpythonframeworkdtypes.py:497: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
      _np_qint32 = np.dtype([("qint32", np.int32, 1)])
    D:python36libsite-packages	ensorflowpythonframeworkdtypes.py:502: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
      np_resource = np.dtype([("resource", np.ubyte, 1)])
    2019-10-16 10:47:11.344409: I C:	f_jenkinsworkspace
    el-winMwindowsPY36	ensorflowcoreplatformcpu_feature_guard.cc:137] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX

    网上查发现numpy的版本过高了我安装的版本是1.17.2,将版本到1.16.0就FutureWarning不在显示了

    pip uninstall numpy        # 卸载numpy
    pip install numpy==1.16.0  # 安装指定版本的numpy

    然后最下面的。。。not compiled to use: AVX警告信息通过添加如下方式忽略

    import os
    os.environ["TF_CPP_MIN_LOG_LEVEL"] = "2"

    这里的2代表是如下

    # TF_CPP_MIN_LOG_LEVEL = 1 //默认设置,为显示所有信息
    # TF_CPP_MIN_LOG_LEVEL = 2 //只显示error和warining信息
    # TF_CPP_MIN_LOG_LEVEL = 3 //只显示error信息

    这样就不再显示启动强迫症的红色警告信息!!!

    参考GodLordGee的笔记:https://blog.csdn.net/GodLordGee/article/details/100579932

    谢谢GodLordGee兄弟。

  • 相关阅读:
    .NET Framework 4.5 中新增的'可移植类库'功能
    使用visual sutdio右键菜单封装字段
    Visual Studio 2008的“组织using”菜单
    HTML5与HTML4的区别
    【百度地图API】如何制作公交线路的搜索?如331路
    【百度地图API】如何给自定义覆盖物添加事件
    【百度地图API】如何制作自定义样式的公交导航结果面板?
    【百度地图API】如何制作可拖拽的沿道路测距
    透过【百度地图API】分析双闭包问题
    【百度地图API】如何用圆形搜索获取中心点周围100米内全部关键点?如天安门附近所有的餐厅、加油站、宾馆、大厦等
  • 原文地址:https://www.cnblogs.com/jumpkin1122/p/11684200.html
Copyright © 2020-2023  润新知