[ERROR:0@1.536] global D:\a\opencv-python\opencv-python\opencv\modules\dnn\src\net_impl.cpp (1203) cv::dnn::dnn4_v20220524::Net::Impl::getLayerShapesRecursively OPENCV/DNN: [Pooling]:(onnx_node!AveragePool_75): getMemoryShapes() post validation failed. inputs=1 outputs=1/1 blobs=0 inplace=0 [ERROR:0@1.536] global D:\a\opencv-python\opencv-python\opencv\modules\dnn\src\net_impl.cpp (1206) cv::dnn::dnn4_v20220524::Net::Impl::getLayerShapesRecursively input[0] = [ 1 128 7 7 ] [ERROR:0@1.536] global D:\a\opencv-python\opencv-python\opencv\modules\dnn\src\net_impl.cpp (1210) cv::dnn::dnn4_v20220524::Net::Impl::getLayerShapesRecursively output[0] = [ 1 128 -2147483648 -2147483648 ] [ERROR:0@1.536] global D:\a\opencv-python\opencv-python\opencv\modules\dnn\src\net_impl.cpp (1216) cv::dnn::dnn4_v20220524::Net::Impl::getLayerShapesRecursively Exception message: OpenCV(4.6.0) D:\a\opencv-python\opencv-python\opencv\modules\dnn\src\net_impl.cpp:1195: error: (-2:Unspecified error) in function 'void __cdecl cv::dnn::dnn4_v20220524::Net::Impl::getLayerShapesRecursively(int,class std::map<int,struct cv::dnn::dnn4_v20220524::detail::LayerShapes,struct std::less<int>,class std::allocator<struct std::pair<int const ,struct cv::dnn::dnn4_v20220524::detail::LayerShapes> > > &)' > (expected: 'total(os[i]) > 0'), where > 'total(os[i])' is 0 > must be greater than > '0' is 0 Traceback (most recent call last): File "C:\Users\20496\Desktop\00\1.py", line 23, in <module> output = net.forward() # 网络的计算,返回网络的输出 cv2.error: OpenCV(4.6.0) D:\a\opencv-python\opencv-python\opencv\modules\dnn\src\net_impl.cpp:1195: error: (-2:Unspecified error) in function 'void __cdecl cv::dnn::dnn4_v20220524::Net::Impl::getLayerShapesRecursively(int,class std::map<int,struct cv::dnn::dnn4_v20220524::detail::LayerShapes,struct std::less<int>,class std::allocator<struct std::pair<int const ,struct cv::dnn::dnn4_v20220524::detail::LayerShapes> > > &)' > (expected: 'total(os[i]) > 0'), where > 'total(os[i])' is 0 > must be greater than > '0' is 0
时间: 2023-07-23 11:58:35 浏览: 209
很抱歉,但我无法提供关于您的问题具体解决方案。这是一个错误,指出在运行您的时发生了错误。根据错误消息,似是与OpenCV库中的神经网络相关的问题您可能需要查看您的代码并检查是否有任何或输出尺寸的问题,以及确您的库版本与代码兼容。如果问题仍存在,您可以尝试在CV或相关论坛上求帮助,以便其他开发者能够更好地帮助您解决问题。
阅读全文