当前位置:网站首页>torch学习(一):环境配置
torch学习(一):环境配置
2022-06-23 16:49:39【因吉】
1 Anaconda安装
Anaconda指的是一个开源的Python发行版本,其包含了conda、Python等多个科学包及其依赖项。
安装可以参考:https://blog.csdn.net/ITLearnHall/article/details/81708148
2 Jupyter安装
Jupyter是数据分析、机器学习的常用工具,其优势在于:
可以将代码、文档等集中在一起,让用户一目了然。
安装可以参考:https://jupyter.org/install或者https://blog.csdn.net/Lee_J_R/article/details/52791228
例如:
pip install jupyterlab
注:若命令"jupyter notebook"报错,可尝试以下方式解决:
1)将"…/Python\Python37\site-packages"添加至路径,重点为site-packages;
2)使用命令"python -m notebook"命令
打开界面如下:
3 CUDA安装
深度学习中不可避免的会使用GPU,故安装的Torch需为GPU版本,故先安装CUDA,步骤如下:
1)打开NVIDIA控制面板,点击帮助,查看系统信息:
2)注意自己的驱动程序版本:我的是399.24
3)查询驱动程序版本与CUDA的对应关系:
图片来源如下:
https://blog.csdn.net/zhw864680355/article/details/90411288
4)在CUDA官网中找到对应版本,官网如下,我选择的是9.2版本:
https://developer.nvidia.com/cuda-toolkit-archive
5)下载好后直接安装,需要注意的是请选择自定义安装,且不选中visual studio,具体参照:
https://blog.csdn.net/u010618587/article/details/82940528
4 Torch安装
本文需要用到PyTorch框架,安装地址如下:
https://pytorch.org/get-started/locally/
具体步骤:
1)选择相应的安装命令:
2)使用国内镜像:
由于直接安装时易出现超时错误,故需移至国内镜像,常用的国内镜像可以参考:
https://blog.csdn.net/sinat_21591675/article/details/82770360
以阿里云为例,安装命令可如下,即添加以下语句于pythoch初始命令中:
-i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com
最终命令如下:
pip install -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com torch==1.3.1+cu92 torchvision==0.4.2+cu92 -f https://download.pytorch.org/whl/torch_stable.html
若出现"Read time out"错误,请多尝试几次,或者换其他镜像源(#^.^#)
3)查看安装是否成功:
import torch
print(torch.cuda.is_available())
若输出True,则安装成功。
致谢
感谢李沐、Aston Zhang等老师的这本《动手学深度学习》一书,为鄙人学习深度学习提供了很大的帮助。本文一系列关于深度学习的博客均无侵权之意,只为记录自己的深度学习历程。
项目Github地址:https://github.com/ShusenTang/Dive-into-DL-PyTorch
边栏推荐
- 手机开户一般哪个证券公司好?在线开户安全么?
- Cross browser common events
- Tencent three sides: how to duplicate 4billion QQ numbers?
- Goframe framework: fast implementation of service end flow limiting Middleware
- What is the problem with TS File Error 404 when easynvr plays HLS protocol?
- [JS reverse hundred examples] pedata encryption information and zlib Application of gunzipsync()
- How code 39 check bits are calculated
- Listen attentively and give back sincerely! Pay tribute to the best product people!
- How to quickly obtain and analyze the housing price in your city?
- Petitpotam – NTLM relay to ad CS
猜你喜欢
Explanation of the principle and code implementation analysis of rainbow docking istio
Drawing black technology - easy to build a "real twin" 2D scene
How to make a shirt certificate
High availability solution practice of mongodb advanced applications (4)
Introduction to GTS Academy
Digital intelligent supply chain collaboration solution for new energy industry
How to create a three elimination game
The mail function is normal locally, and the ECS reports an error
POC about secureworks' recent azure Active Directory password brute force vulnerability
Similarities and differences between Chinese and American electronic signature SaaS
随机推荐
- Company offensive operation guide
- Go unit test
- Intelligent supply chain collaborative management solution for logistics industry
- PostgreSQL series articles -- the world's most advanced open source relational database
- Script to view the execution of SQLSERVER database stored procedures
- Transaction processing of cloud development database
- Skills that all applet developers should know: applying applet components
- ACM players take you to play with the array!
- Kotlin invoke convention makes kotlin code more concise
- January 5, 2022: there are four kinds of rhythms: AABB, ABAB and ABB
- Lighthouse open source application practice: o2oa
- . Net cloud native architect training camp (responsibility chain mode) -- learning notes
- Android kotlin exception handling
- Best practices cloud development cloudbase content audit capability
- The principle of MySQL index algorithm and the use of common indexes
- Goframe framework: graceful closing process
- Nanny level teaching! Take you to play with time complexity and space complexity!
- How to design a seckill system - geek course notes
- Method of copying web page content and automatically adding copyright information (compatible with ie, Firefox and chrome)
- [Hyperf]Entry “xxxInterface“ cannot be resolved: the class is not instantiable
- How to use JSON data format
- console. Log() is an asynchronous operation???
- Kdevtmpfsi processing of mining virus -- Practice
- Also using copy and paste to create test data, try the data assistant!
- Async/await
- Programmers are very useful ten tool websites, which are worth collecting
- Troubleshooting and modification process of easycvr interface dislocation in small screen
- Reinforcement learning series (I) -- basic concepts
- Easygbs playback screen is continuously loading. Troubleshooting
- 13. IP address and subnet partitioning (VLSM)
- 12. Manage network environment
- Illustration of mongodb cluster deployment principle (3)
- 6、VLAN
- What if the website is poisoned
- 7、VLAN-Trunk
- Revil - blackmail Virus Emergency Response
- How to make a badge
- Alien world, real presentation, how does the alien version of Pokemon go achieve?
- How to use R language to draw scatter diagram
- How to make validity table