GStreamer-CRITICAL **: 00:17:58.906: gst_mini_object_set_qdata: assertion 'object != NULL' failed

am trying to lunch the detection model through a python script but each time am getting this error and the program freezes on that. also the load on the cpu gos back to normal as if nothing is running.

i’ve used 3 scripts from the tutorials but all ends the same way

import jetson.inference
import jetson.utils

net = jetson.inference.detectNet("ssd-mobilenet-v2", threshold=0.5)
camera = jetson.utils.videoSource("csi://0")      # '/dev/video0' for V4L2
display = jetson.utils.videoOutput("display://0") # 'my_video.mp4' for file

while display.IsStreaming():
	img = camera.Capture()
	detections = net.Detect(img)
	display.Render(img)
	display.SetStatus("Object Detection | Network {:.0f} FPS".format(net.GetNetworkFPS()))
import cv2
import jetson.inference
import jetson.utils
import time

import numpy as np
width=1280
height=720
#cam=jetson.utils.gstCamera(width,height,'/dev/video1')
cam=jetson.utils.gstCamera(width,height,'0')
net=jetson.inference.imageNet('googlenet')
timeMark=time.time()
fpsFilter=0
timeMark=time.time()
font=cv2.FONT_HERSHEY_SIMPLEX
while True:
    frame, width, height = cam.CaptureRGBA(zeroCopy=1)
    classID, confidence = net.Classify(frame, width, height)
    item = net.GetClassDesc(classID)
    dt=time.time()-timeMark
    fps=1/dt
    fpsFilter=.95*fpsFilter+.05*fps
    timeMark=time.time()
    frame=jetson.utils.cudaToNumpy(frame,width,height,4)
    frame=cv2.cvtColor(frame, cv2.COLOR_RGBA2BGR).astype(np.uint8)
    cv2.putText(frame,str(round(fpsFilter,1))+'      '+item,(0,30),font,1,(0,0,255),2)
    cv2.imshow('webCam',frame)
    cv2.moveWindow('webCam',0,0)
    if cv2.waitKey(1)==ord('q'):
        break
cam.release()
cv2.destroyAllWindows()

Hi,

The error is related to the camera session.
What kind of camera do you use?

It’s expected to use an onboard (CSI) camera by default.
If you have a USB camera, please make the corresponding updates to the below line:

camera = jetson.utils.videoSource("csi://0")      # '/dev/video0' for V4L2

Thanks.

its a CSI camera

so its working some times and mostly after i do a reboot.
but now the problem is that the script suddenly stops and the camera window closes. this is only happens when i sue my mode (the ssd-mobilenet-v2 works fine)
i used the first code:

import jetson.inference
import jetson.utils


#net = jetson.inference.detectNet("ssd-mobilenet-v2", threshold=0.5)
net=jetson.inference.detectNet(argv=['--model=jetson-inference/python/training/detection/ssd/models/gg/ssd-mobilenet.onnx', '--label=jetson-inference/python/training/detection/ssd/models/gg/labels.txt', '--input-blob=input_0', '--output-cvg=scores', '--output-bbox=boxes'], threshold=0.5)

camera = jetson.utils.videoSource("csi://0")      # '/dev/video0' for V4L2
display = jetson.utils.videoOutput("display://0") # 'my_video.mp4' for file

while display.IsStreaming():
	img = camera.Capture()
	detections = net.Detect(img)
	display.Render(img)
	display.SetStatus("Object Detection | Network {:.0f} FPS".format(net.GetNetworkFPS()))

Screenshot from 2021-09-01 18-16-53

i tried to use the second code but am getting an error for the line
classID, confidence = net.Classify(frame, width, height)
specifically the net.Classify

Hi,

Is your model a classifier or a detector?
Which backbond model do you use?

More, you may need to change the default network based on your custom model.
For example, output layer name:

https://rawgit.com/dusty-nv/jetson-inference/python/docs/html/python/jetson.inference.html#detectNet

Thanks.

Not sure at all; but is it different if creating first the display, then camera then net ?

hi AastaLLL. its a detection model
am so new to this so forgive me i dont know which backbond it is,is it like SSD ?

this is the error am getting when trying to use the second code

unfortunately Honey i just tried it but no success

Hi,

It seems that you open another topic already:

Do you fix this issue or they are different problems?
Thanks.

yes they are the same but i thought its better to open it in a separate topic

Let’s track the following on the above topic directly.