当前位置:网站首页>pytorch框架学习(2)使用GPU训练
pytorch框架学习(2)使用GPU训练
2022-08-10 05:29:00 【Time.Xu】
使用GPU进行训练&常见的Tensor&Hub模块
需要将数据和模型传入到CUDA里进行运算。
在代码上:
与传统的不同的是我们需要指定一个设备,这个设备就是设定为cuda:0
需要把模型放置到我们设定的设备中(CUDA中) .to(设备)
需要把数据放置到我呢设定的设备中(CUDA中) .to(设备)

常见的Tensor有哪些形式
| 形式 | 备注 | 代码&注释 |
|---|---|---|
| Scalar | 数值 | dim是0,标量 |
| Vector | 向量 | dim是1,在深度学习中通常指特征,例如词向量,某一个维度的特征等 |
| matrix | 矩阵 | dim是2,一行就是一个向量。可以认为每一行是每一个人,每一列是同一种特征。 矩阵能做乘法能做内积 |
| n-dimensal tensor | 高维张量 | Aijk… |
强大的Hub模块
Hub是为了方便开发者调用已有的代码,是一个model zoo
torch.hub.load()
学习一般不用这个
边栏推荐
- Abstract problem methodology
- I have a dream for Career .
- PyTorch 入门之旅
- strongest brain (1)
- 基于Qiskit——《量子计算编程实战》读书笔记(六)
- 【Pei Shu Theorem】CF1055C Lucky Days
- WSTP初体验
- [Thesis Notes] Prototypical Contrast Adaptation for Domain Adaptive Semantic Segmentation
- FPGA engineer interview questions collection 21~30
- flex 相关
猜你喜欢

Interface debugging also can play this?

Arduino框架下合宙ESP32C3 +1.8“tft 网络时钟

通过一个案例轻松入门OAuth协议

接口文档进化图鉴,有些古早接口文档工具,你可能都没用过

论文精度 —— 2017 ACM《Globally and Locally Consistent Image Completion》

一文带你搞懂OAuth2.0

AVL树的插入--旋转笔记

Depth of carding: prevent model fitting method

Talk about API Management - Open Source Edition to SaaS Edition

基于Qiskit——《量子计算编程实战》读书笔记(三)
随机推荐
应用在智能触摸遥控器中的触摸芯片
一篇文章带你搞懂什么是幂等性问题?如何解决幂等性问题?
Kubernetes:(十七)Helm概述、安装及配置
mysql常用命令有什么
OAuth2的使用场景、常见误区、使用案例
AVL树的插入--旋转笔记
oracle rac 11g安装执行root.sh时报错
An article will help you understand what is idempotency?How to solve the idempotency problem?
MySQL simple tutorial
Stacks and Queues | Valid parentheses, delete all adjacent elements in a string, reverse Polish expression evaluation, maximum sliding window, top K high frequency elements | leecode brush questions
如何用Apifox 的智能Mock功能?
基于Qiskit——《量子计算编程实战》读书笔记(二)
Interface debugging also can play this?
SSM框架整合实例
论文精读 —— 2021 CVPR《Progressive Temporal Feature Alignment Network for Video Inpainting》
Flutter开发:报错The following assertion was thrown resolving an image codec:Unable to…的解决方法
大佬们,运行cdc后oracle归档日志20分钟增长3G是正常现象吗
Pony语言学习(七)——表达式(Expressions)语法(单篇向)
最强大脑(1)
Conda creates a virtual environment method and pqi uses a domestic mirror source to install a third-party library method tutorial