解决numpy版本过高产生的警告FutureWarning: Passing (type, 1) or ‘1type‘ as a synonym of type is deprecated;

/home/linux/.conda/envs/tf_py3/lib/python3.5/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/linux/.conda/envs/tf_py3/lib/python3.5/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版本过高,我的是1.18的版本,使用:

pip install numpy==1.16.0

命令降一下版本后,这个警告就消失了;

你可能感兴趣的:(环境依赖,版本相关)