Skip to content

Commit deec3c5

Browse files
authored
Merge pull request #199 from Stanley-Zheng/master
Fixes #189
2 parents 4c20d74 + 03972f2 commit deec3c5

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

dataset.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ def __init__(self, lable_path, cfg, train=True):
258258
data = line.split(" ")
259259
truth[data[0]] = []
260260
for i in data[1:]:
261-
truth[data[0]].append([int(j) for j in i.split(',')])
261+
truth[data[0]].append([int(float(j)) for j in i.split(',')])
262262

263263
self.truth = truth
264264
self.imgs = list(self.truth.keys())

tool/darknet2pytorch.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -246,15 +246,15 @@ def create_network(self, blocks):
246246
conv_id = 0
247247
for block in blocks:
248248
if block['type'] == 'net':
249-
prev_filters = int(block['channels'])
249+
prev_filters = int(float(block['channels']))
250250
continue
251251
elif block['type'] == 'convolutional':
252252
conv_id = conv_id + 1
253-
batch_normalize = int(block['batch_normalize'])
254-
filters = int(block['filters'])
255-
kernel_size = int(block['size'])
256-
stride = int(block['stride'])
257-
is_pad = int(block['pad'])
253+
batch_normalize = int(float(block['batch_normalize']))
254+
filters = int(float(block['filters']))
255+
kernel_size = int(float(block['size']))
256+
stride = int(float(block['stride']))
257+
is_pad = int(float(block['pad']))
258258
pad = (kernel_size - 1) // 2 if is_pad else 0
259259
activation = block['activation']
260260
model = nn.Sequential()

0 commit comments

Comments
 (0)