当前位置:   article > 正文

[tensorflow] FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated

futurewarning: passing (type, 1) or '1type' as a synonym of type is deprecat

在导入tensorflow的时候报了这样的提示:

  1. /usr/local/anaconda3/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:516: 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'.
  2. _np_qint8 = np.dtype([("qint8", np.int8, 1)])
  3. /usr/local/anaconda3/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:517: 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'.
  4. _np_quint8 = np.dtype([("quint8", np.uint8, 1)])
  5. /usr/local/anaconda3/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:518: 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'.
  6. _np_qint16 = np.dtype([("qint16", np.int16, 1)])
  7. /usr/local/anaconda3/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:519: 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'.
  8. _np_quint16 = np.dtype([("quint16", np.uint16, 1)])
  9. /usr/local/anaconda3/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:520: 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'.
  10. _np_qint32 = np.dtype([("qint32", np.int32, 1)])
  11. /usr/local/anaconda3/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.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'.
  12. np_resource = np.dtype([("resource", np.ubyte, 1)])
  13. /usr/local/anaconda3/lib/python3.6/site-packages/h5py/__init__.py:36: FutureWarning: Conversion of the second argument of issubdtype from `float` to `np.floating` is deprecated. In future, it will be treated as `np.float64 == np.dtype(float).type`.
  14. from ._conv import register_converters as _register_converters
  15. /usr/local/anaconda3/lib/python3.6/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py:541: 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'.
  16. _np_qint8 = np.dtype([("qint8", np.int8, 1)])
  17. /usr/local/anaconda3/lib/python3.6/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py:542: 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'.
  18. _np_quint8 = np.dtype([("quint8", np.uint8, 1)])
  19. /usr/local/anaconda3/lib/python3.6/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py:543: 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'.
  20. _np_qint16 = np.dtype([("qint16", np.int16, 1)])
  21. /usr/local/anaconda3/lib/python3.6/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py:544: 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'.
  22. _np_quint16 = np.dtype([("quint16", np.uint16, 1)])
  23. /usr/local/anaconda3/lib/python3.6/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py:545: 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'.
  24. _np_qint32 = np.dtype([("qint32", np.int32, 1)])
  25. /usr/local/anaconda3/lib/python3.6/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py:550: 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'.
  26. np_resource = np.dtype([("resource", np.ubyte, 1)])

错误的原因应该是numpy版本不对应吧,当前的numpy版本是1.17,所以我就降级为1.16(tensorflow 1.x用到的版本不会太新,是1.16及以下,但是像mxnet,用到了numpy是大于1.16,如果同时装了mxnet和tensorflow一般会报这个错):

pip install numpy==1.16.0

然后安装1.16版本的numpy即可。

明月别枝惊鹊,清风半夜鸣蝉。

稻花香里说丰年,听取蛙声一片。

七八个星天外,两三点雨山前。

旧时茅店社林边,路转溪桥忽见。

  --辛弃疾 《西江月·夜行黄沙道中》

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/凡人多烦事01/article/detail/311575
推荐阅读
相关标签
  

闽ICP备14008679号