import tensorflow出现一堆乱七八糟的东西
/home/ubuntu/anaconda3/envs/ztf/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_qint8 = np.dtype([(“qint8”, np.int8, 1)])
/home/ubuntu/anaconda3/envs/ztf/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_quint8 = np.dtype([(“quint8”, np.uint8, 1)])
/home/ubuntu/anaconda3/envs/ztf/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:528: 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/ubuntu/anaconda3/envs/ztf/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:529: 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/ubuntu/anaconda3/envs/ztf/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:530: 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/ubuntu/anaconda3/envs/ztf/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:535: 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)])
本人在Ubuntu下安装tensorflow-gpu==1.13.1出现上述警告,虽然不影响程序的运行,但是出现这些警告让我感觉很不舒服,于是进行解决。
首先,我觉得应该是tensorflow和已经存在的numpy版本不兼容导致,根据提示:
我将现有的numpy ==1.17.4升级到numpy ==1.18.0后,问题没有解决!!
于是百度了一下。。。。
这个xiongdei跟我遇到相同的问题:
https://blog.youkuaiyun.com/weixin_43981221/article/details/103049129
https://blog.youkuaiyun.com/qq_41975844/article/details/99622948
Ta是通过改变源码解决的。我认为这样做并不好。
坚持认为是版本不兼容的问题,于是继续百度找tensorflow和numpy对应版本关系。
最终找到如下博客:
Ta也遇到相同的问题,并且给出了解决办法。
将numpy换位1.16.0版本,成功解决!!!
https://blog.youkuaiyun.com/joyce_ff/article/details/103534152
总结:
tensorflow-gpu == 1.13.1
keras == 2.1.5
numpy == 1.16.0