def _parse_layer_params(layer_desc_, num_expected):
    """Extracts parameters from network description layer and raises if there are issues."""
    layer_type_, layer_params = layer_desc_[0], layer_desc_[1:]
    if len(layer_params) != num_expected:
        raise ValueError("Expected {} parameters for layer {} but received {}: {}".format(num_expected, layer_type_, len(layer_params), layer_params))
    return layer_params