当前位置:网站首页>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的区别 
边栏推荐
猜你喜欢
随机推荐
链读|最新最全的数字藏品发售日历-08.02
Four characteristics of ACID
视图【】【】【】【】
转载fstream,ifstream的详细用法
分享一款恋爱星座男女配对微信小程序源码
Linux数据库Oracle客户端安装,用于shell脚本用sqlplus连接数据库
常用类 BigDecimal
pytorch-08.加载数据集
IO流【】【】【】
国内数字藏品投资价值分析
LeetCode 1351.统计有序矩阵中的负数(简单)
最新最全的数字藏品发售日历-07.27
优先队列
error in ./node_modules/cesium/Source/ThirdParty/zip.js
微信小程序--模板与设置WXML
微信小程序wx.writeBLECharacteristicValue汉字转buffer问题
Database Notes Create Database, Table Backup
Analysis of the investment value of domestic digital collections
符号表
Chain Reading Recommendation: From Tiles to Generative NFTs