我正在训练一个 CNN 模型。我在为我的模型进行训练迭代时遇到了问题。代码如下:
class Net(nn.Module):
def __init__(self):
super(Net, self).__init__()
#convo layers
self.conv1 = nn.Conv2d(3,32,3)
self.conv2 = nn.Conv2d(32,64,3)
self.conv3 = nn.Conv2d(64,128,3)
self.conv4 = nn.Conv2d(128,256,3)
self.conv5 = nn.Conv2d(256,512,3)
#pooling layer
self.pool = nn.MaxPool2d(2,2)
#linear layers
self.fc1 = nn.Linear(512*5*5,2048)
self.fc2 = nn.Linear(2048,1024)
self.fc3 = nn.Linear(1024,133)
#dropout layer
self.dropout = nn.Dropout(0.3)
def forward(self, x):
#first layer
x = self.conv1(x)
x = F.relu(x)
x = self.pool(x)
#x = self.dropout(x)
#second layer
x = self.conv2(x)
x = F.relu(x)
x = self.pool(x)
#x = self.dropout(x)
#third layer …Run Code Online (Sandbox Code Playgroud) 我正在尝试使用 Flask 制作一个程序,让您快速创建页面。基本上我想这样做,这样我就可以/在动态 URL 中使用斜杠 (),例如,路线是,<page>我输入,我希望它与存在localhost:5000/test/page一起去。这可能吗?<page><page>test/page