ptython FutureWarning

/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)