Pytorch中的VGG实现修改最后一层FC
作者:ForABiggerWorld 时间:2023-03-08 07:08:48
https://discuss.pytorch.org/t/how-to-modify-the-final-fc-layer-based-on-the-torch-model/766/12
That's because vgg19 doesn't have a fc member variable. Instead, it has a
(classifier): Sequential (
(0): Dropout (p = 0.5)
(1): Linear (25088 -> 4096)
(2): ReLU (inplace)
(3): Dropout (p = 0.5)
(4): Linear (4096 -> 4096)
(5): ReLU (inplace)
(6): Linear (4096 -> 100)
)
To replace the last linear layer, a temporary solution would be
vgg19.classifier._modules['6'] = nn.Linear(4096, 8)
来源:https://blog.csdn.net/zjucor/article/details/83713356
标签:Pytorch,VGG,FC
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
修改apache配置文件去除thinkphp url中的index.php
2024-05-21 10:21:10
Python实现将DNA序列存储为tfr文件并读取流程介绍
2021-08-04 08:02:23
![](https://img.aspxhome.com/file/2023/0/133700_0s.png)
ASP 读取MP3文件帧的信息比特率,采样频率,播放时间
2010-06-04 12:22:00
Python2.x版本中基本的中文编码问题解决
2021-01-06 14:02:16
了解WEB页面工具语言XML(四)应用分类
2008-09-05 17:18:00
DVWA下载、安装、使用(漏洞测试环境搭建)的详细教程
2022-07-08 21:20:59
![](https://img.aspxhome.com/file/2023/4/131814_0s.png)
在vue.js中使用JSZip实现在前端解压文件的方法
2024-04-22 22:15:34
![](https://img.aspxhome.com/file/2023/9/136059_0s.jpg)
javascript中caller和callee详解
2024-04-29 13:38:05
JS实现求5的阶乘示例
2024-04-30 10:09:43
![](https://img.aspxhome.com/file/2023/2/130502_0s.png)
升级SQL Server 2008数据库引擎
2009-03-25 12:58:00
探索webpack模块及webpack3新特性
2024-05-21 10:13:48
MySQL 主从同步,事务回滚的实现原理
2024-01-17 14:16:51
TorchVision Transforms API目标检测实例语义分割视频类
2022-12-05 14:24:56
![](https://img.aspxhome.com/file/2023/5/92455_0s.png)
Django的URLconf中使用缺省视图参数的方法
2021-05-03 17:46:29
vue中element-ui组件默认css样式修改的四种方式
2024-05-09 10:50:45
![](https://img.aspxhome.com/file/2023/6/126596_0s.jpg)
HTML 5 预览
2008-01-24 12:17:00
![](https://img.aspxhome.com/file/UploadPic/20081/24/2008124122637981s.gif)
Django框架基础模板标签与filter使用方法详解
2022-10-25 18:14:43
![](https://img.aspxhome.com/file/2023/5/66295_0s.png)
由浅入深讲解python中的yield与generator
2022-08-14 06:26:11
详解Python flask的前后端交互
2023-03-19 06:41:05
![](https://img.aspxhome.com/file/2023/0/117420_0s.png)
Python-基础-入门 简介
2023-03-28 19:08:07