当前位置:网站首页>PyTorch之训练技巧
PyTorch之训练技巧
2022-08-10 05:33:00 【Vector Jason】
微调
例如:
修改模型(将1000类改为10类输出)
model = timm.create_model('resnet34',num_classes=10,pretrained=True)
x = torch.randn(1,3,224,224)
output = model(x)
output.shape输出为:
torch.Size([1, 10])
改变输入通道数(比如我们传入的图片是单通道的,但是模型需要的是三通道图片) 我们可以通过添加in_chans=1来改变
model = timm.create_model('resnet34',num_classes=10,pretrained=True,in_chans=1)
x = torch.randn(1,1,224,224)
output = model(x)

PS:关于float16与float32的区别 
边栏推荐
- Ten years of sharpening a sword!The digital collection market software, Link Reading APP is officially open for internal testing!
- pytorch-11.卷积神经网络(高级篇)
- 文本元素
- Smart contracts and DAPP decentralized applications
- Four characteristics of ACID
- 集合 Map
- 链表API设计
- LeetCode 面试题17.14 最小k个数(中等)
- Operation table Function usage
- 树结构——2-3树图解
猜你喜欢

tinymce rich text editor
![[Notes] Collection Framework System Collection](/img/6a/f0e69ebb60a3d958ec7bda33a60995.png)
[Notes] Collection Framework System Collection

链读好文:Jeff Garzik 推出 Web3 制作公司

深度学习TensorFlow入门环境配置

The Principle of Union Search and API Design

LeetCode 1351.统计有序矩阵中的负数(简单)

十年磨一剑!数字藏品行情软件,链读APP正式开放内测!

棋类游戏-五子棋小游戏
![[List Exercise] Traverse the collection and sort by price from low to high,](/img/49/183ebabf99e31af0d095bfd05a0b1f.png)
[List Exercise] Traverse the collection and sort by price from low to high,

Collection工具类
随机推荐
Notes 1
opencv
Chain Reading | The latest and most complete digital collection calendar-07.28
连接 Nacos 报超时错误
力扣——情侣牵手
LeetCode 剑指offer 21.调整数组顺序使奇数位于偶数前面(简单)
程序员副业赚钱之道,实现月收入增加20K
Consensus calculation and incentive mechanism
Collection Map
深度学习TensorFlow入门环境配置
常用类 BigDecimal
学生管理系统以及其简单功能的实现
The complex "metaverse" will be interpreted for you, and the Link Reading APP will be launched soon!
The submenu of the el-cascader cascade selector is double-clicked to display the selected content
IO流【】【】【】
一个基于.Net Core跨平台小程序考试系统
A timeout error is reported when connecting to Nacos
cesium add point, move point
一个基于.Net Core 开源的物联网基础平台
先人一步,不再错过,链读APP即将上线!