def inspect_conv_channels(self, layer_name):
        """ Prints the output and kernel channels of a convolution layer.
        """
        if self.spec is None:
            return
        if layer_name not in self.layer_specs:
            raise ValueError("Layer %s does not exist." % (layer_name))
        spec_layer = self.layer_specs[layer_name]

        if spec_layer.WhichOneof("layer") != "convolution":
            raise ValueError("Layer %s is not a convolution layer." % (layer_name))

        output_channels = spec_layer.convolution.outputChannels
        kernel_channels = spec_layer.convolution.kernelChannels
        print("outputChannels: {}".format(output_channels))
        print("kernelChannels: {}".format(kernel_channels))
 Prints the output and kernel channels of a convolution layer.
        
coremltools/models/neural_network/builder.py