Skip to content

Commit e7342bb

Browse files
committed
fixing APU
1 parent 3601ea5 commit e7342bb

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

imagenet/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ def forward(self, input):
7676
train, batch_size=args.batchSize, shuffle=True, num_workers=args.nThreads)
7777

7878
criterion = nn.CrossEntropyLoss().cuda()
79-
optimizer = torch.optim.SGD(model, learningRate, momentum)
79+
optimizer = torch.optim.SGD(model.parameters(), learningRate, momentum)
8080
t = trainer.Trainer(model, criterion, optimizer, train_loader)
8181

8282
t.register_plugin(trainer.plugins.ProgressMonitor())

imagenet/resnet.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
def conv3x3(in_planes, out_planes, stride=1):
66
"3x3 convolution with padding"
77
return nn.Conv2d(in_planes, out_planes, kernel_size=3, stride=stride,
8-
padding=1, no_bias=True)
8+
padding=1, bias=False)
99

1010

1111
class BasicBlock(nn.Container):
@@ -46,12 +46,12 @@ class Bottleneck(nn.Container):
4646

4747
def __init__(self, inplanes, planes, stride=1, downsample=None):
4848
super(Bottleneck, self).__init__(
49-
conv1=nn.Conv2d(inplanes, planes, kernel_size=1, no_bias=True),
49+
conv1=nn.Conv2d(inplanes, planes, kernel_size=1, bias=False),
5050
bn1=nn.BatchNorm2d(planes),
5151
conv2=nn.Conv2d(planes, planes, kernel_size=3, stride=stride,
52-
padding=1, no_bias=True),
52+
padding=1, bias=False),
5353
bn2=nn.BatchNorm2d(planes),
54-
conv3=nn.Conv2d(planes, planes * 4, kernel_size=1, no_bias=True),
54+
conv3=nn.Conv2d(planes, planes * 4, kernel_size=1, bias=False),
5555
bn3=nn.BatchNorm2d(planes * 4),
5656
relu=nn.ReLU(inplace=True),
5757
downsample=downsample,
@@ -86,7 +86,7 @@ def __init__(self, block, layers):
8686
self.inplanes = 64
8787
super(ResNet, self).__init__(
8888
conv1=nn.Conv2d(3, 64, kernel_size=7, stride=2, padding=3,
89-
no_bias=True),
89+
bias=False),
9090
bn1=nn.BatchNorm2d(64),
9191
relu=nn.ReLU(inplace=True),
9292
maxpool=nn.MaxPool2d(kernel_size=3, stride=2, padding=1),
@@ -110,7 +110,7 @@ def _make_layer(self, block, planes, blocks, stride=1):
110110
if stride != 1 or self.inplanes != planes * block.expansion:
111111
downsample = nn.Sequential(
112112
nn.Conv2d(self.inplanes, planes * block.expansion,
113-
kernel_size=1, stride=stride, no_bias=True),
113+
kernel_size=1, stride=stride, bias=False),
114114
nn.BatchNorm2d(planes * block.expansion),
115115
)
116116

0 commit comments

Comments
 (0)