Ask Your Question
0

cv2.error: OpenCV(4.0.0): …(-215:Assertion failed)… ONNXImporter::getLayerParams'

asked 2020-11-18 13:03:14 -0500

Tina  J gravatar image

I was trying to run a code for activity detection, but I get the following error. What is the problem? I have OpenCV(4.0.0) and am using windows. It's my first time running a DNN with openCV.

model = "resnet-34_kinetics.onnx"
classess = "action_recognition_kinetics.txt"
input_video = "video1.mp4" 

# load the human activity recognition model
print("[INFO] loading human activity recognition model...")
net = cv2.dnn.readNet(model)
# grab a pointer to the input video stream
print("[INFO] accessing video stream...")
vs = cv2.VideoCapture(input_video if input_video else 0)
...

And the error:

Traceback (most recent call last):
  File "code.py", line 20, in <module>
    net = cv2.dnn.readNet(model)
cv2.error: OpenCV(4.0.0) C:\projects\opencv-python\opencv\modules\dnn\src\onnx\onnx_importer.cpp:215: error: (-215:Assertion failed) attribute_proto.ints_size() == 2 in function 'cv::dnn::dnn4_v20180917::ONNXImporter::getLayerParams'
edit retag flag offensive close merge delete

1 answer

Sort by » oldest newest most voted
0

answered 2020-11-19 02:15:57 -0500

berak gravatar image

updated 2020-11-19 02:40:01 -0500

I have OpenCV(4.0.0)

please use recent 4.5.0 instead, if you want to do anything with the dnn module

(file was added may 2019, so you need at least 4.2.0)

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2020-11-18 13:03:14 -0500

Seen: 42 times

Last updated: Nov 18