-
-
Notifications
You must be signed in to change notification settings - Fork 56.5k
Darknet/YoloV3, changing input resolution cause the "Inconsistent shape for ConcatLayer" error #13462
Description
OpenCV 4.0.0
I have a problem with running Darknet/YoloV3 network with different input resolutions on the same network. If I do not change input resolution I can process images with same resolution without problems.
- WORKS OK
cv::dnn::Net net = cv::dnn::readNetFromDarknet(....)
cv::dnn::blobFromImage(image, blob, 1 / 255.F, cv::Size(416, 416));
net.setInput(blob);
net.forward(outs, this->net_output_names);
cv::dnn::blobFromImage(image, blob, 1 / 255.F, cv::Size(416, 416));
net.setInput(blob);
net.forward(outs, this->net_output_names);
- WORKS OK
cv::dnn::Net net = cv::dnn::readNetFromDarknet(....)
cv::dnn::blobFromImage(image, blob, 1 / 255.F, cv::Size(448, 448));
net.setInput(blob);
net.forward(outs, this->net_output_names);
cv::dnn::blobFromImage(image, blob, 1 / 255.F, cv::Size(448, 448));
net.setInput(blob);
net.forward(outs, this->net_output_names);
- "Inconsistent shape for ConcatLayer" exception
cv::dnn::Net net = cv::dnn::readNetFromDarknet(....)
cv::dnn::blobFromImage(image, blob, 1 / 255.F, cv::Size(416, 416));
net.setInput(blob);
net.forward(outs, this->net_output_names);
cv::dnn::blobFromImage(image, blob, 1 / 255.F, cv::Size(448, 448)); // <=== resulution changed
net.setInput(blob);
net.forward(outs, this->net_output_names); // <=== "Inconsistent shape for ConcatLayer" exception