I have tried to use goturn tracker and it fails with error not being able to allocate 95GB of memory.
I have compiled the OpenCV with CUDA enabled flags, however goturn fails with the same error if I use non CUDA enabled OpenCV build
I have used caffe prototxt and caffemodel files available.
Ptr<Tracker> tracker = TrackerGOTURN::create()
tracker->init(frame, bbox)'
```.cpp terminate called after throwing an instance of 'cv::Exception'
what(): OpenCV(4.2.0) /home/mirko/programiranje/ocv42install/opencv/modules/core/src/alloc.cpp:73: error: (-4:Insufficient memory) Failed to allocate 95588562276 bytes in function 'OutOfMemoryError'
Having the same issue with python as well. Same OpenCV version.
I wonder what other similarities we have, we appear to be the other ones having this specific issue.
Tested:
So it appears that the bounding box is growing large enough to cause the memory issue. I'm going to try to limit its size and see if that fixes the issue (no clue how to actually do that).
the culprit of the problem for OpenCV 4.2.0 is not in inference itself. Loading caffe model causes the error. It doesn't reach the inference at all.
Works fine with python2.7 and openCV3.X.X
Loading caffe model causes the error.
can be reproduced with opencv4.x like:
net = cv2.dnn.readNet("goturn.caffemodel", "goturn.prototxt")
Same issue with python as well :
OS: Arch Windows 64bit
OpenCV: 4.2.0
Any idea on how to fix this ?
Please try patch from here: https://github.com/opencv/opencv/pull/16617
Hi! As a temporal workaround please try to comment the following lines:
input: "data1"
# input_dim: 1
# input_dim: 3
# input_dim: 227
# input_dim: 227
input: "data2"
# input_dim: 1
# input_dim: 3
# input_dim: 227
# input_dim: 227
Sorry for inconvenience!
import numpy as np
import cv2 as cv
net = cv.dnn.readNet('goturn.prototxt', 'goturn.caffemodel')
inp0 = np.random.standard_normal([1, 3, 227, 227]).astype(np.float32)
inp1 = np.random.standard_normal([1, 3, 227, 227]).astype(np.float32)
net.setInput(inp0, "data1")
net.setInput(inp1, "data2")
net.forward()
Most helpful comment
Hi! As a temporal workaround please try to comment the following lines:
Sorry for inconvenience!