Skip to content

Commit ae5a75e

Browse files
authored
Merge pull request amdegroot#90 from jackiechen0708/master
add support for python2
2 parents c8ec468 + c8d33e0 commit ae5a75e

File tree

5 files changed

+9
-5
lines changed

5 files changed

+9
-5
lines changed

layers/box_utils.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# -*- coding: utf-8 -*-
12
import torch
23

34
def point_form(boxes):

layers/functions/prior_box.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
from __future__ import division
12
import torch
23
from math import sqrt as sqrt
34
from itertools import product as product

layers/modules/l2norm.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ def reset_parameters(self):
1818

1919
def forward(self, x):
2020
norm = x.pow(2).sum(dim=1, keepdim=True).sqrt()+self.eps
21-
x /= norm
21+
#x /= norm
22+
x = torch.div(x,norm)
2223
out = self.weight.unsqueeze(0).unsqueeze(2).unsqueeze(3).expand_as(x) * x
2324
return out

layers/modules/multibox_loss.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# -*- coding: utf-8 -*-
12
import torch
23
import torch.nn as nn
34
import torch.nn.functional as F

ssd.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ def build_ssd(phase, size=300, num_classes=21):
199199
if size != 300:
200200
print("Error: Sorry only SSD300 is supported currently!")
201201
return
202-
203-
return SSD(phase, *multibox(vgg(base[str(size)], 3),
204-
add_extras(extras[str(size)], 1024),
205-
mbox[str(size)], num_classes), num_classes)
202+
base_,extras_,head_=multibox(vgg(base[str(size)], 3),
203+
add_extras(extras[str(size)], 1024),
204+
mbox[str(size)], num_classes)
205+
return SSD(phase,base_,extras_,head_, num_classes)

0 commit comments

Comments
 (0)