From efcec18e12b5dbf38a278a5a3dfb2f19ea72dfd1 Mon Sep 17 00:00:00 2001 From: Seth Troisi Date: Wed, 13 Feb 2019 02:40:19 -0800 Subject: [PATCH] Tweak conversion script for ELF v2. Small tweak to conversion script for ELF v2 weights. Pull request #2213. --- training/elf/elf_convert.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/training/elf/elf_convert.py b/training/elf/elf_convert.py index cf8412ea3..89d65a442 100755 --- a/training/elf/elf_convert.py +++ b/training/elf/elf_convert.py @@ -41,7 +41,10 @@ def write_block(f, b): with open('elf_converted_weights.txt', 'w') as f: # version 2 means value head is for black, not for side to move f.write('2\n') - b = convert_block(state, 'init_conv') + if 'init_conv.0.weight' in state: + b = convert_block(state, 'init_conv') + else: + b = convert_block(state, 'init_conv.module') # Permutate input planes p = [0, 2, 4, 6, 8, 10, 12, 14, 1, 3, 5, 7, 9, 11, 13, 15, 16, 17]