美文网首页
ptython FutureWarning

ptython FutureWarning

作者: 布口袋_天晴了 | 来源:发表于2019-11-11 11:35 被阅读0次

    /root/anaconda3/envs/python3.5/lib/python3.5/site-packages/tensorflow/python/framework/dtypes.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)])
    /root/anaconda3/envs/python3.5/lib/python3.5/site-packages/tensorflow/python/framework/dtypes.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)])

    两种解决方案:
    【方案一】tensorflow提示FutureWarning
    将numpy的版本降级: pip install numpy<1.17
    任意安装一个numpy版本:pip install numpy==1.16.0

    【方案二】python 消除 futureWarning

    from warnings import simplefilter
    simplefilter(action='ignore', category=FutureWarning)
    or
    import warnings
    warnings.filterwarnings("ignore")
    

    这种方法必须找到报FutureWarning的脚本,在相应的脚本中添加这个语句。

    方案一更可靠。

    相关文章

      网友评论

          本文标题:ptython FutureWarning

          本文链接:https://www.haomeiwen.com/subject/ahftictx.html