opencv / opencv/opencv-python

error: OpenCV(4.9.0) D:\a\opencv-python\opencv-python\opencv\modules\dnn\src\layers\convolution_layer.cpp:396: error: (-2:Unspecified error) Number of input channels should be multiple of 3 but got 4 in function 'cv::dnn::ConvolutionLayerImpl::getMemoryShapes'

Open
#1,011 10 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
5.4k
Forks
1k
Avg merge
22h 17m
Merged PRs (30d)
3

Description

(Translated using DeepL)

Expected behaviour

Normal output.

Actual behaviour

After Auto Focus Cropping is enabled
Click the "Generate" button
error: OpenCV(4.9.0) D:\a\opencv-python\opencv-python\opencv\modules\dnn\src\layers\convolution_layer.cpp:396: error: (-2:Unspecified error) Number of input channels should be multiple of 3 but got 4 in function 'cv::dnn::ConvolutionLayerImpl::getMemoryShapes'
image

Steps to reproduce
  • Windows 10
  • x86
  • 4.9.0.80
Issue submission checklist
  • [√] This is not a generic OpenCV usage question (looking for help for coding, other usage questions, homework etc.)
  • [ √] I have read the README of this repository and understand that this repository provides only an automated build toolchain for OpenCV Python packages (there is no actual OpenCV code here)
  • [?] The issue is related to the build scripts in this repository, to the pre-built binaries or is a feature request (such as "please enable this additional dependency")
  • [×] I'm using the latest version of opencv-python
    Version 4.10.0.84 also doesn't work and doesn't report any error messages

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No repository file, test, or entry point is identified. Start by reproducing the Windows 10 x86 case with opencv-python 4.9.0.80 after enabling Auto Focus Cropping and clicking Generate; compare the reported behavior with 4.10.0.84. Done would require a repository-scoped diagnosis and a verified fix or clarified upstream report.

Written by the indexing model from the issue text.

Assessment

Tech stack
opencv, python
Domain
computer-vision
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.