栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Python

Pytorch+jupyter notebook+win10开发环境搭建

Python 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

Pytorch+jupyter notebook+win10开发环境搭建

文章目录
  • 一、Pytorch安装
    • 1.安装anaconda
    • 2.更新软件源
    • 3.创建并激活虚拟环境
    • 4.安装pytorch
  • 二、conda命令
  • 三、jupyter notebook设置
    • 1.UI设置
    • 2.虚拟环境中使用jupyter notebook
    • 3.增加代码补全

一、Pytorch安装 1.安装anaconda 2.更新软件源
  • conda config
  • 打开 C:Users用户名.condarc 文件, 修改为:
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/cloud/conda-forge/
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/Paddle/
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/fastai/
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda/
ssl_verify: false
show_channel_urls: true
3.创建并激活虚拟环境

conda create -n env_name python=3.7
activate env_name

4.安装pytorch

官网地址:pytorch官网
根据自己硬件环境生成相应的安装命令, 我的是
conda install pytorch torchvision torchaudio cpuonly
注意要 去掉末尾的-c pytorch,这个默认安装渠道为官方渠道,可能会很慢

二、conda命令
conda info 查看软件源
conda info -e 查看所有虚拟环境
三、jupyter notebook设置 1.UI设置

两种风格

jt -t oceans16 -f fira -fs 14 -cellw 96% -ofs 14 -dfs 14 -T
jt --lineh 140 -f consolamono -cellw 96% -tf ptmono -t grade3 -ofs 14 -nfs 14 -tfs 14 -fs 16 -T -N
2.虚拟环境中使用jupyter notebook

conda install nb_conda

3.增加代码补全
conda install jupyter_contrib_nbextensions
jupyter contrib nbextension install --user --skip-running-check

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/329236.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号