Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Android OpenCV Tensorflow crashes with CvException

Hi,

I'm loading a default tensorflow dnn model with:

    val config = getPath("ssd_mobilenet_v1_coco_2017_11_17.pbtxt", this)
    val model = getPath("frozen_inference_graph.pb", this)
    net = Dnn.readNetFromTensorflow(model, config)

and it works fine. But after less then 1-2 minutes the application crashes with CvException.

 CvException [org.opencv.core.CvException: cv::Exception: OpenCV(3.4.1) /build/master_pack-android/opencv/modules/core/src/matrix.cpp:362: error: (-215) u != 0 in function void cv::Mat::create(int, const int*, int)
]
    at org.opencv.imgproc.Imgproc.cvtColor_0(Native Method)
    at org.opencv.imgproc.Imgproc.cvtColor(Imgproc.java:1887)
    at org.opencv.android.JavaCameraView$JavaCameraFrame.rgba(JavaCameraView.java:322)
    at com.argos.android.opencv.activity.DnnActivity.onCameraFrame(DnnActivity.kt:84)
    at org.opencv.android.CameraBridgeViewBase.deliverAndDrawFrame(CameraBridgeViewBase.java:392)
    at org.opencv.android.JavaCameraView$CameraWorker.run(JavaCameraView.java:373)
    at java.lang.Thread.run(Thread.java:764)

Is there anything I can do to avoid this ?

Android OpenCV Tensorflow crashes with CvException

Hi,

I'm loading a default tensorflow dnn model with:

    val config = getPath("ssd_mobilenet_v1_coco_2017_11_17.pbtxt", this)
    val model = getPath("frozen_inference_graph.pb", this)
    net = Dnn.readNetFromTensorflow(model, config)

and it works fine. But after less then 1-2 minutes the application crashes with CvException.

 CvException [org.opencv.core.CvException: cv::Exception: OpenCV(3.4.1) /build/master_pack-android/opencv/modules/core/src/matrix.cpp:362: error: (-215) u != 0 in function void cv::Mat::create(int, const int*, int)
]
    at org.opencv.imgproc.Imgproc.cvtColor_0(Native Method)
    at org.opencv.imgproc.Imgproc.cvtColor(Imgproc.java:1887)
    at org.opencv.android.JavaCameraView$JavaCameraFrame.rgba(JavaCameraView.java:322)
    at com.argos.android.opencv.activity.DnnActivity.onCameraFrame(DnnActivity.kt:84)
    at org.opencv.android.CameraBridgeViewBase.deliverAndDrawFrame(CameraBridgeViewBase.java:392)
    at org.opencv.android.JavaCameraView$CameraWorker.run(JavaCameraView.java:373)
    at java.lang.Thread.run(Thread.java:764)

Is there anything I can do to avoid this ?

click to hide/show revision 3
retagged

updated 2018-05-11 14:05:34 -0600

berak gravatar image

Android OpenCV Tensorflow crashes with CvException

Hi,

I'm loading a default tensorflow dnn model with:

    val config = getPath("ssd_mobilenet_v1_coco_2017_11_17.pbtxt", this)
    val model = getPath("frozen_inference_graph.pb", this)
    net = Dnn.readNetFromTensorflow(model, config)

and it works fine. But after less then 1-2 minutes the application crashes with CvException.

 CvException [org.opencv.core.CvException: cv::Exception: OpenCV(3.4.1) /build/master_pack-android/opencv/modules/core/src/matrix.cpp:362: error: (-215) u != 0 in function void cv::Mat::create(int, const int*, int)
]
    at org.opencv.imgproc.Imgproc.cvtColor_0(Native Method)
    at org.opencv.imgproc.Imgproc.cvtColor(Imgproc.java:1887)
    at org.opencv.android.JavaCameraView$JavaCameraFrame.rgba(JavaCameraView.java:322)
    at com.argos.android.opencv.activity.DnnActivity.onCameraFrame(DnnActivity.kt:84)
    at org.opencv.android.CameraBridgeViewBase.deliverAndDrawFrame(CameraBridgeViewBase.java:392)
    at org.opencv.android.JavaCameraView$CameraWorker.run(JavaCameraView.java:373)
    at java.lang.Thread.run(Thread.java:764)

Is there anything I can do to avoid this ?

Android OpenCV Tensorflow crashes with CvExceptionCvException because of native Memory leak

Hi,

I'm loading a default tensorflow dnn model with:

    val config = getPath("ssd_mobilenet_v1_coco_2017_11_17.pbtxt", this)
    val model = getPath("frozen_inference_graph.pb", this)
    net = Dnn.readNetFromTensorflow(model, config)

and it works fine. But after less then 1-2 minutes the application crashes with CvException.

 CvException [org.opencv.core.CvException: cv::Exception: OpenCV(3.4.1) /build/master_pack-android/opencv/modules/core/src/matrix.cpp:362: error: (-215) u != 0 in function void cv::Mat::create(int, const int*, int)
]
    at org.opencv.imgproc.Imgproc.cvtColor_0(Native Method)
    at org.opencv.imgproc.Imgproc.cvtColor(Imgproc.java:1887)
    at org.opencv.android.JavaCameraView$JavaCameraFrame.rgba(JavaCameraView.java:322)
    at com.argos.android.opencv.activity.DnnActivity.onCameraFrame(DnnActivity.kt:84)
    at org.opencv.android.CameraBridgeViewBase.deliverAndDrawFrame(CameraBridgeViewBase.java:392)
    at org.opencv.android.JavaCameraView$CameraWorker.run(JavaCameraView.java:373)
    at java.lang.Thread.run(Thread.java:764)

Is there anything I can do to avoid this ?

image description