作者:mobiledu2502884677 | 来源:互联网 | 2023-05-17 09:12
TheinputtomynetworkisanRGBimagewithdimensionsnm,howcanIgettheoutputtohavedimensi
The input to my network is an RGB image with dimensions nm, how can I get the output to have dimensions of nm.
我的网络的输入是一个带有尺寸nm的RGB图像,我怎样才能使输出的尺寸为nm。
class Net(nn.Module):
def __init__(self):
super(Net, self).__init__()
self.conv1 = nn.Conv2d(3, 20, kernel_size = 5)
self.conv2 = nn.Conv2d(20, 50, kernel_size = 3)
self.conv3 = nn.ConvTranspose2d(50,20, kernel_size = 5)
self.conv4 = nn.ConvTranspose2d(20,1, kernel_size = 3)
def forward(self, x):
x = F.relu(self.conv1(x))
x = F.relu(self.conv2(x))
x = F.relu(self.conv3(x))
x = F.relu(self.conv4(x))
return x
I currently output a 1 * n * m. How can I output an n*m?
我现在输出的是1 * n*m,如何输出n*m?
1 个解决方案