{"record":{"id":"0e8a0d9de9131722","repo":"keras-team/keras","slug":"the-convolution-operation-resulted-in-an-empty-out-0e8a0d","errorCode":null,"errorMessage":"The convolution operation resulted in an empty output. This can happen if the input is too small for the given kernel size, strides, dilation rate, and padding mode. Please check the input shape and convolution parameters.","messagePattern":"The convolution operation resulted in an empty output\\. This can happen if the input is too small for the given kernel size, strides, dilation rate, and padding mode\\. Please check the input shape and convolution parameters\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"keras/src/backend/numpy/nn.py","lineNumber":676,"sourceCode":"        raise ValueError(\n            \"The number of input channels must be evenly divisible by \"\n            f\"kernel's in_channels. Received input channels {channels} and \"\n            f\"kernel in_channels {kernel_in_channels}. \"\n        )\n    feature_group_count = channels // kernel_in_channels\n    result = np.array(\n        jax.lax.conv_general_dilated(\n            inputs,\n            kernel if is_tensor(kernel) else kernel.numpy(),\n            strides,\n            padding,\n            rhs_dilation=dilation_rate,\n            dimension_numbers=dimension_numbers,\n            feature_group_count=feature_group_count,\n        )\n    )\n    if result.size == 0 and inputs.size != 0:\n        raise ValueError(\n            \"The convolution operation resulted in an empty output. \"\n            \"This can happen if the input is too small for the given \"\n            \"kernel size, strides, dilation rate, and padding mode. \"\n            \"Please check the input shape and convolution parameters.\"\n        )\n    return result\n\n\ndef depthwise_conv(\n    inputs,\n    kernel,\n    strides=1,\n    padding=\"valid\",\n    data_format=None,\n    dilation_rate=1,\n):\n    data_format = backend.standardize_data_format(data_format)\n    inputs = convert_to_tensor(inputs)","sourceCodeStart":658,"sourceCodeEnd":694,"githubUrl":"https://github.com/keras-team/keras/blob/7a34a03db60bf60042242d6a556fc3be119046a5/keras/src/backend/numpy/nn.py#L658-L694","documentation":"Error \"The convolution operation resulted in an empty output. This can happen if the input is too small for the given kernel size, strides, dilation rate, and padding mode. Please check the input shape and convolution parameters.\" thrown in keras-team/keras.","triggerScenarios":"Thrown at keras/src/backend/numpy/nn.py:676 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"7a34a03db60bf60042242d6a556fc3be119046a5","analyzedAt":"2026-08-25T21:25:25.994Z","schemaVersion":2},"datasetVersion":"2026-08-26T02:17:13.382Z"}