【发布时间】:2020-11-09 14:11:45
【问题描述】:
例如,我定义了如下所示的模型:
class Net(nn.module):
def __init__():
self.conv11 = nn.Conv2d(in_channel,out1_channel,3)
self.conv12 = nn.Conv2d(...)
self.conv13 = nn.Conv2d(...)
self.conv14 = nn.Conv2d(...)
...
#Here is the point
flat = nn.Flatten()
#I don't want to compute the size of data after flatten, but I need a linear layer.
fc_out = nn.Linear(???,out_dim)
问题是线性层,我不想计算线性层输入的大小,但定义模型需要指定它。我该如何解决这个问题?
【问题讨论】:
标签: python deep-learning pytorch