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'