diff --git a/qkeras/qconvolutional.py b/qkeras/qconvolutional.py index 8e4c9f40..0902311c 100644 --- a/qkeras/qconvolutional.py +++ b/qkeras/qconvolutional.py @@ -474,10 +474,11 @@ def call(self, inputs, training=None): def get_config(self): config = super(QDepthwiseConv2D, self).get_config() - config.pop("filters", None) - config.pop("kernel_initializer", None) - config.pop("kernel_regularizer", None) - config.pop("kernel_constraint", None) + for x,y in (("filters", None), + ("kernel_initializer", None), + ("kernel_regularizer", None), + ("kernel_constraint", None)): + config.pop(x,y) config["depth_multiplier"] = self.depth_multiplier config["depthwise_initializer"] = initializers.serialize( self.depthwise_initializer)