问题描述
在tensorflow.contrib模块的调用报错
'No module named 'tensorflow.contrib'
解决方案:
我给删了大不了不用了:(
好吧其实能解决:使用anaconda新建tensorflow1版本
切换国内镜像源:(加速下载)
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/ conda config --set show_channel_urls yes
安装tensorflow1:
conda install --channel https://conda.anaconda.org/anaconda tensorflow=1.14.0
查看tensorflow安装版本和路径:
进入anaconda的prompt,先输入python
import tensorFlow as tf tf.__version__ 查看版本 tf.__path_ 查看安装路径 **注意:__ 是两个下划线**
keras下载:
pip install keras==2.2.4 -i https://pypi.tuna.tsinghua.edu.cn/simple
ps: (1)安装包方法 conda 的包管理功能和pip 是⼀样的,当然你选择pip 来安装包也是没问题的。conda install matplotlib (2)卸载包方法 conda remove matplotlib
附:tensorflow和python的对应关系:



