ubuntu18.04安装tensorflo后,import tensorflow出现/usr/local/lib/python3.6/dist-packages/tensorflow/python/

问题:import tensorflow 之后出现这些提示符
/usr/local/lib/python3.6/dist-packages/tensorflow/python/framework/dtypes.py:493: 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)])
/usr/local/lib/python3.6/dist-packages/tensorflow/python/framework/dtypes.py:494: 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)])
/usr/local/lib/python3.6/dist-packages/tensorflow/python/framework/dtypes.py:495: 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)])
/usr/local/lib/python3.6/dist-packages/tensorflow/python/framework/dtypes.py:496: 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版本太高了(in a future version of numpy) 我的numpy是1.17.1,我把版本降低到1.15.0

解决办法: 先卸载numpy: sudo pip3 uninstall numpy
再安装比较低的版本: sudo python3 -m pip install -i https://pypi.tuna.tsinghua.edu.cn/simple numpy==1.15.0

你可能感兴趣的:(ubunut,tensorflow,import,出错)