zoukankan      html  css  js  c++  java
  • 关于tensorflow和numpy版本问题FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated;

    当tensorflow和numpy版本对应出现问题时运行程序会出现以下错误:

    D:anaconda3libsite-packages	ensorflowpythonframeworkdtypes.py:523: 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:anaconda3libsite-packages	ensorflowpythonframeworkdtypes.py:524: 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:anaconda3libsite-packages	ensorflowpythonframeworkdtypes.py:525: 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:anaconda3libsite-packages	ensorflowpythonframeworkdtypes.py:526: 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:anaconda3libsite-packages	ensorflowpythonframeworkdtypes.py:527: 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:anaconda3libsite-packages	ensorflowpythonframeworkdtypes.py:532: 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'.

    解决问题的方法是降低numpy的版本:

    方法一:进入pycharm点击文件->设置->Python解释器,找到下载的numpy并双击

    image

    进入后勾选“指定版本”选择较小的numpy版本后点击安装

    image

    方法二:进入anaconda prompt

    输入pip uninstall numpy卸载原有的numpy

    输入pip install numpy=替换版本号

    image

  • 相关阅读:
    代码风格
    C语言带返回值的宏
    设计模式之PIMPL模式
    打印控制之VT100
    C语言实现反射
    C语言实现函数override
    [BZOJ3669] [NOI2004] 魔法森林 LCT维护最小生成树
    [BZOJ4826] [HNOI2017] 影魔 单调栈 主席树
    [BZOJ2054]疯狂的馒头 并查集
    [BZOJ5305] [HAOI2018] 苹果树 数学 组合计数
  • 原文地址:https://www.cnblogs.com/Uriel-w/p/14959677.html
Copyright © 2011-2022 走看看