hpc203 / crowdcounting-p2pnet-opencv

使用OpenCV部署P2PNet人群检测和计数,包含C++和Python两种版本的实现
49 stars 11 forks source link

运行报错 #3

Open zfcfuture opened 2 years ago

zfcfuture commented 2 years ago

环境:python3.9 + python-opencv(4.6) 运行报错如下: `[ERROR:0@0.126] global /io/opencv/modules/dnn/src/onnx/onnx_importer.cpp (2845) parseShape DNN/ONNX(Shape): dynamic 'zero' shapes are not supported, input 180 [ 0 0 0 8 ] [ERROR:0@0.126] global /io/opencv/modules/dnn/src/onnx/onnx_importer.cpp (1018) handleNode DNN/ONNX: ERROR during processing node with 1 inputs and 1 outputs: [Shape]:(onnx_node!Shape_41) from domain='ai.onnx' Traceback (most recent call last): File "/home/user/code/crowdcounting-p2pnet-opencv/main.py", line 112, in net = P2PNet(args.onnx_path, confThreshold=args.conf_threshold) File "/home/user/code/crowdcounting-p2pnet-opencv/main.py", line 68, in init self.model = cv2.dnn.readNet(modelPath) cv2.error: OpenCV(4.6.0) /io/opencv/modules/dnn/src/onnx/onnx_importer.cpp:1040: error: (-2:Unspecified error) in function 'handleNode'

Node [Shape@ai.onnx]:(onnx_node!Shape_41) parse error: OpenCV(4.6.0) /io/opencv/modules/dnn/src/onnx/onnx_importer.cpp:2846: error: (-215:Assertion failed) !isDynamicShape in function 'parseShape' `

sanersbug commented 1 year ago

I meet the same error, have you solved? [ERROR:0@0.113] global D:\a\opencv-python\opencv-python\opencv\modules\dnn\src\onnx\onnx_importer.cpp (2845) cv::dnn::dnn4_v20220524::ONNXImporter::parseShape DNN/ONNX(Shape): dynamic 'zero' shapes are not supported, input 180 [ 0 0 0 8 ] [ERROR:0@0.120] global D:\a\opencv-python\opencv-python\opencv\modules\dnn\src\onnx\onnx_importer.cpp (1021) cv::dnn::dnn4_v20220524::ONNXImporter::handleNode DNN/ONNX: ERROR during processing node with 1 inputs and 1 outputs: [Shape]:(onnx_node!Shape_41) from domain='ai.onnx' Traceback (most recent call last): File "main.py", line 112, in net = P2PNet(args.onnx_path, confThreshold=args.conf_threshold) File "main.py", line 68, in init self.model = cv2.dnn.readNet(modelPath) cv2.error: OpenCV(4.6.0) D:\a\opencv-python\opencv-python\opencv\modules\dnn\src\onnx\onnx_importer.cpp:1040: error: (-2:Unspecified error) in function 'cv::dnn::dnn4_v20220524::ONNXImporter::handleNode'

Node [Shape@ai.onnx]:(onnx_node!Shape_41) parse error: OpenCV(4.6.0) D:\a\opencv-python\opencv-python\opencv\modules\dnn\src\onnx\onnx_importer.cpp:2846: error: (-215:Assertion failed) !isDynamicShape in function 'cv::dnn::dnn4_v20220524::ONNXImporter::parseShape'