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


    【吴恩达课程使用】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:
      - defaults
    show_channel_urls: true
    default_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/r
    custom_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:Anaconda3envspython35python.exe: No module named ipykernel
    

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

    conda install ipykernel
    

    3.在系统内切换

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

    pip install pypiwin32
    

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

  • 相关阅读:
    关于前端基础框架的思考和尝试
    通过当前IP获取当前网卡的MAC地址
    shell及脚本2——shell 环境及命令
    shell及脚本1——变量
    linux显示git commit id,同时解决insmod模块时版本不一致导致无法加载问题
    大于16MB的QSPI存放程序引起的ZYNQ重启风险
    insmod模块的几种常见错误
    shell及脚本3——正则表达式
    修改/etc/profile和/etc/environment导致图形界面无法登陆的问题
    Sql 2008的merge关键字
  • 原文地址:https://www.cnblogs.com/phoenixash/p/12132197.html
Copyright © 2020-2023  润新知