TensorFlow:FutureWarning: Passing (type, 1) or ‘1type‘ as a synonym of type is deprecated;

验证TensorFlow安装时, 出现了一个问题:

python3 -c "import tensorflow as tf; print(tf.__version__)"

TensorFlow:FutureWarning: Passing (type, 1) or ‘1type‘ as a synonym of type is deprecated;_第1张图片错误原因:numpy版本过高,降低numpy版本即可

查看numpy版本

pip3 show numpy

TensorFlow:FutureWarning: Passing (type, 1) or ‘1type‘ as a synonym of type is deprecated;_第2张图片

解决方法:卸载numpy-1.17.3

pip3 install numpy

卸载后,再次查看numpy版本
TensorFlow:FutureWarning: Passing (type, 1) or ‘1type‘ as a synonym of type is deprecated;_第3张图片

再次卸载numpy,直到不存在numpy,再安装合适版本的numpy

pip3 install numpy==1.16.4

再安装,成功输出TensorFlow的版本信息
在这里插入图片描述

你可能感兴趣的:(Linux(Ubuntu),工具)