zoukankan      html  css  js  c++  java
  • 【吴恩达课程使用】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内直接切换了:

  • 相关阅读:
    牛客网-求和
    牛客网-删除公共字符
    牛客网-字符串中找出连续最长的数字串(好未来)
    牛客网-求数列的和(挖财)
    牛客网-树的高度(小米)
    牛客网-藏宝图(网易)
    【Python学习笔记】
    php平滑升级
    Nginx平滑升级
    linux下线刷硬盘
  • 原文地址:https://www.cnblogs.com/phoenixash/p/12132197.html
Copyright © 2011-2022 走看看