Skip to content

Commit 03972f2

Browse files
Update darknet2pytorch.py
1 parent 686ff48 commit 03972f2

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

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)