本文只适用于python环境为anaconda
1.解决方案
采用conda安装tensorflow,不要使用pip
conda install tensorflow
2.tips
将numpy版本换成:1.16.4,否则会报FutureWarning警告:
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'.
pip3 install numpy==1.16.4