Skip to content

Commit

Permalink
TFDWConv() depthwise_initializer fix (#7845)
Browse files Browse the repository at this point in the history
  • Loading branch information
glenn-jocher committed May 16, 2022
1 parent 05d4fc9 commit b52fd48
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion models/tf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b52fd48

Please sign in to comment.