From 370bf769a2a3e087f9bb52d87285a09c052b9c87 Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Mon, 16 May 2022 23:26:49 +0200 Subject: [PATCH] TFDWConv() `depthwise_initializer` fix --- models/tf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/models/tf.py b/models/tf.py index 3428032a0aa7..c638ff0084bc 100644 --- a/models/tf.py +++ b/models/tf.py @@ -97,7 +97,7 @@ def __init__(self, c1, c2, k=1, s=1, p=None, act=True, w=None): strides=s, padding='SAME' if s == 1 else 'VALID', use_bias=not hasattr(w, 'bn'), - kernel_initializer=keras.initializers.Constant(w.conv.weight.permute(2, 3, 1, 0).numpy()), + depthwise_initializer=keras.initializers.Constant(w.conv.weight.permute(2, 3, 1, 0).numpy()), bias_initializer='zeros' if hasattr(w, 'bn') else keras.initializers.Constant(w.conv.bias.numpy())) self.conv = conv if s == 1 else keras.Sequential([TFPad(autopad(k, p)), conv]) self.bn = TFBN(w.bn) if hasattr(w, 'bn') else tf.identity