- 博客(3)
- 收藏
- 关注
原创 pytorch 如何加载预训练权重并更改网络某一层的卷积核
我们提取resnet的网络作为基础网络,同时加载预训练权重。class Backbone(nn.Module): def __init__(self, pretrain_path=None): super(Backbone, self).__init__() net = resnet50() self.out_channels = [1024, 512, 512, 256, 256, 256] #加载预训练权重 if pre
2021-07-13 09:18:52
2738
4
原创 pytorch rnn
pytorch RNNrnn流程图在说rnn时有2个点需要注意,其中上图rnn从左到右表示时间序列,理解为一个句子一个个词的输入。还有一个是从下到上表示多层的rnn,图中只有一层。rnn参数import torchimport torch.nn as nnrnn = nn.RNN(100, 20) print(rnn._parameters.keys())print(rnn.weight_ih_l0.shape) # w_{xh} [20, 100]print(rnn.weight
2021-07-11 22:15:04
190
原创 class path resource xxx.xml cannot be opened because it does not exist
Caused by: java.io.FileNotFoundException: class path resource [work7.xml] cannot be opened because it does not exist记录一下错误:把pom.xml中的<packaging>pom</packaging>去掉,否则会找不到class path resource
2021-04-28 08:43:24
332
1
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人