前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >Tensorflow

Tensorflow

作者头像
Dean0731
发布2020-05-08 15:29:32
6990
发布2020-05-08 15:29:32
举报
文章被收录于专栏:blog-技术博客

1,下载anaconda 安装

##################################################################

new method

pypi 镜像使用帮助

pypi 镜像每 5 分钟同步一次。

临时使用

代码语言:javascript
复制
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple some-package

注意,simple 不能少, 是 https 而不是 http

设为默认

升级 pip 到最新的版本 (>=10.0.0) 后进行配置:

代码语言:javascript
复制
pip install pip -U
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple

如果您到 pip 默认源的网络连接较差,临时使用本镜像站来升级 pip:

代码语言:javascript
复制
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple pip -U

##########################################################################

注:设置国内镜像

conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/ conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/ conda config --set show_channel_urls yes

conda config --remove channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/ conda config --add channels https://repo.continuum.io/pkgs/free/ conda config --add channels https://repo.continuum.io/pkgs/main/ conda config --set show_channel_urls yes

删除添加的镜像

conda config --remove-key channels

2,配置环境变量

  anaconda3/Scripts

  anaconda3/Library/bin

  anaconda3/library/mingw-64/bin

  linux:export PATH=$PATH:/home/software/anaconda3/bin

此时配置完成 操作时主要是用 scripts下的conda.exe

注意:执行命令例如: conda list

  (4.7版本以上)若未配置path,直接找到conda 命令执行时可能会报错,

      需要先进入base虚拟环境 再进行conda操作 (进入condabin文件夹 conda.bat activate 进入base虚拟环境)

    若配置了path 应该不会报错

  常用命令 conda info --envs 查看所有的虚拟环境

3,创建tensorflow虚拟环境

conda create -n tensorflow(只是个名字) python=3.7.3(根据ananconda的版本决定)

4,conda activate tensorflow 进入tensorflow 虚拟环境

5,安装tensorflow pip install tensorflow-gpu==版本号

# 版本1.1---》1.15 cuda 9及以下

# 版本2.0-》.... cuda 10

6,conda deactivate 退出虚拟环境

========================================

conda create -n py3 python=3 # 创建一个python3的环境,名为py3

source activate py3 # 激活py3环境

conda install ipykernel # 安装ipykernel模块

python -m ipykernel install --user --name=py3 # 进行配置

jupyter notebook # 启动jupyter notebook then can choose python environment

注:

pip3 install -i https://pypi.tuna.tsinghua.edu.cn/simple/ --upgrade tensorflow # for Python 3.* pip3 install -i https://pypi.tuna.tsinghua.edu.cn/simple/ --upgrade tensorflow-gpu # for Python 3.* and GPU

阿里云 http://mirrors.aliyun.com/pypi/simple/

中国科技大学 https://pypi.mirrors.ustc.edu.cn/simple/

豆瓣(douban) http://pypi.douban.com/simple/

清华大学 https://pypi.tuna.tsinghua.edu.cn/simple/

中国科学技术大学 http://pypi.mirrors.ustc.edu.cn/simple/

本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2019-09-20 ,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • pypi 镜像使用帮助
    • 临时使用
      • 设为默认
      领券
      问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档