打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
【吴恩达课程使用】anaconda (python 3.7) win10安装 tensorflow 1.8

【吴恩达课程使用】anaconda (python 3.7) win10安装 tensorflow 1.8

目前tensorflow是只支持到python3.6的,anaconda最新版本已经到python3.7。因为吴恩达课程比较旧一些,这里就配置更加稳定的win10 python3.5 tensorflow1.8版本。

一、国内镜像源配置

https://mirror.tuna.tsinghua.edu.cn/help/anaconda/

各系统都可以通过修改用户目录下的 .condarc 文件:

channels:  - defaultsshow_channel_urls: truedefault_channels:  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/rcustom_channels:  conda-forge: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud  msys2: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud  bioconda: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud  menpo: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud  pytorch: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud  simpleitk: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud

即可添加 Anaconda Python 免费仓库。Windows 用户无法直接创建名为 .condarc 的文件,可先执行 conda config --set show_channel_urls yes 生成该文件之后再修改。

二、虚拟环境安装

1.安装anaconda3并在开始菜单打开Anaconda Prompt

2.执行命令:

conda create --name tensorflow10 python=3.5

3.当询问是否执行时,输入y(yes)

成功后:

4.执行命令

conda activate tensorflow10

即可进入tensorflow10环境。

在tensorflow10环境下执行命令

pip install tensorflow==1.8.0

三、jupyter notebook的相关配置

1.首先激活对应的conda环境

conda activate tensorflow10

2.将环境写入notebook的kernel中

python -m ipykernel install --user --name tensorflow10 --display-name "Python (tensorflow10)"

如果没有安装ipykernel会报错:

D:\Anaconda3\envs\python35\python.exe: No module named ipykernel

这时需要安装ipykernel,执行命令:

conda install ipykernel

3.在系统内切换

jupyter会出现 import error win32api 错误,解决:

pip install pypiwin32

之后就可以在jupyter内直接切换了:

来源:https://www.icode9.com/content-1-607101.html
本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
生信分析平台搭建(七):bioconda
使用Anaconda Python科学计算包 | 流光
Anaconda出现CondaHTTPError: HTTP 000 CONNECTION FAILED for url的解决方法
使用好镜像源,把等待的时间转为生产力
Miniconda——搭建Python开发环境的最优解
关于conda和anaconda不可不知的误解和事实
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服