FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future versioni

import keras时出现警告。

个人有请强迫症,看到警告也无法忍受,所以找了一下解决办法。

先看一下警告:
/home/sdu-gdiv/anaconda3/envs/py36-jjg/lib/python3.6/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)])
/home/sdu-gdiv/anaconda3/envs/py36-jjg/lib/python3.6/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)])
/home/sdu-gdiv/anaconda3/envs/py36-jjg/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'.
  _np_qint16 = np.dtype([("qint16", np.int16, 1)])
/home/sdu-gdiv/anaconda3/envs/py36-jjg/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.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)])
/home/sdu-gdiv/anaconda3/envs/py36-jjg/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.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)])
/home/sdu-gdiv/anaconda3/envs/py36-jjg/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.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'.
  np_resource = np.dtype([("resource", np.ubyte, 1)])

原因:numpy的版本更新了,有些方法改了,报出了未来的警告。

解决办法:降低numpy版本,conda install numpy==1.16

附上自己装的keras用到的所有包:


 

发布了141 篇原创文章 · 获赞 54 · 访问量 15万+

猜你喜欢

转载自blog.csdn.net/iamjingong/article/details/101050534
今日推荐