Skip to content

Commit a1271e8

Browse files
DeepC004Deep
and
Deep
authored
Removes warnings displayed on running main.py (pytorch#1117)
Co-authored-by: Deep <deepchordia004@gmail.com>
1 parent 0252bda commit a1271e8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

siamese_network/main.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class SiameseNetwork(nn.Module):
2727
def __init__(self):
2828
super(SiameseNetwork, self).__init__()
2929
# get resnet model
30-
self.resnet = torchvision.models.resnet18(pretrained=False)
30+
self.resnet = torchvision.models.resnet18(weights=None)
3131

3232
# over-write the first conv layer to be able to read MNIST images
3333
# as resnet18 reads (3,x,x) where 3 is RGB channels
@@ -53,7 +53,7 @@ def __init__(self):
5353

5454
def init_weights(self, m):
5555
if isinstance(m, nn.Linear):
56-
torch.nn.init.xavier_uniform(m.weight)
56+
torch.nn.init.xavier_uniform_(m.weight)
5757
m.bias.data.fill_(0.01)
5858

5959
def forward_once(self, x):

0 commit comments

Comments
 (0)