Skip to content

Commit 8afb643

Browse files
authored
convert_model.py: for compatibility with new pytorch
1 parent d18e0f3 commit 8afb643

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

convert_model.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,9 @@ def update_model(old_model):
6161
_update_model_res_skip(old_model, new_model)
6262
if hasattr(old_model.WN[0], 'cond_layers'):
6363
_update_model_cond(old_model, new_model)
64+
for m in new_model.modules():
65+
if 'Conv' in str(type(m)) and not hasattr(m, 'padding_mode'):
66+
setattr(m, 'padding_mode', 'zeros')
6467
return new_model
6568

6669
if __name__ == '__main__':

0 commit comments

Comments
 (0)