# Difference between two model?

I have two models. Is there any difference between two models?

First one ------

``````model = nn.Sequential(
nn.ReLU(),
nn.MaxPool2d(2, 2),

nn.ReLU(),
nn.MaxPool2d(2, 2),

nn.ReLU(),
nn.MaxPool2d(2, 2),

nn.Flatten(1, -1),

nn.Dropout(0.25),
nn.Linear(4*4*64, 500),
nn.ReLU(),

nn.Dropout(0.25),
nn.Linear(500, 10))
``````

Second one ----

``````class Net(nn.Module):
def __init__(self):
super().__init__()

self.conv1 = nn.Conv2d(3, 16, 3, padding=1)

self.conv2 = nn.Conv2d(16, 32, 3, padding=1)

self.conv3 = nn.Conv2d(32, 64, 3, padding=1)

self.pool = nn.MaxPool2d(2, 2)

self.fc1 = nn.Linear(64 * 4 * 4, 500)

self.fc2 = nn.Linear(500, 10)

self.dropout = nn.Dropout(0.25)

def forward(self, x):

x = self.pool(F.relu(self.conv1(x)))
x = self.pool(F.relu(self.conv2(x)))
x = self.pool(F.relu(self.conv3(x)))

x = x.view(-1, 64 * 4 * 4)

x = self.dropout(x)

x = F.relu(self.fc1(x))

x = self.dropout(x)

x = self.fc2(x)
return x

model = Net()
``````

When i load the save model of Second one to the first one, it shows error.

-------------------------------------- First Model Parameters----------------------------------------
<bound method Module.parameters of Sequential(
(0): Conv2d(3, 16, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1))
(1): ReLU()
(2): MaxPool2d(kernel_size=2, stride=2, padding=0, dilation=1, ceil_mode=False)
(3): Conv2d(16, 32, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1))
(4): ReLU()
(5): MaxPool2d(kernel_size=2, stride=2, padding=0, dilation=1, ceil_mode=False)
(6): Conv2d(32, 64, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1))
(7): ReLU()
(8): MaxPool2d(kernel_size=2, stride=2, padding=0, dilation=1, ceil_mode=False)
(9): Flatten(start_dim=1, end_dim=-1)
(10): Dropout(p=0.25, inplace=False)
(11): Linear(in_features=1024, out_features=500, bias=True)
(12): ReLU()
(13): Dropout(p=0.25, inplace=False)
(14): Linear(in_features=500, out_features=10, bias=True)
)>
-------------------------------------- Second Model Parameters ----------------------------------------
<bound method Module.parameters of Net(
(conv1): Conv2d(3, 16, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1))
(conv2): Conv2d(16, 32, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1))
(conv3): Conv2d(32, 64, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1))
(pool): MaxPool2d(kernel_size=2, stride=2, padding=0, dilation=1, ceil_mode=False)
(fc1): Linear(in_features=1024, out_features=500, bias=True)
(fc2): Linear(in_features=500, out_features=10, bias=True)
(dropout): Dropout(p=0.25, inplace=False)
)>
As you see, these two model parameters are not the same