Skip to content

Commit

Permalink
Tweak conversion script for ELF v2.
Browse files Browse the repository at this point in the history
Small tweak to conversion script for ELF v2 weights.

Pull request leela-zero#2213.
  • Loading branch information
sethtroisi authored and gcp committed Feb 13, 2019
1 parent d8ea34d commit efcec18
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion training/elf/elf_convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down

0 comments on commit efcec18

Please sign in to comment.