Jetson TX2 and USB camera: DetectNet error after initial success

Hi all,

After following the tutorial here GitHub - dusty-nv/jetson-inference: Hello AI World guide to deploying deep-learning inference networks and deep vision primitives with TensorRT and NVIDIA Jetson., I was able to successfully modify the DEFAULT_CAMERA line at the top of imagenet-camera.cpp to accommodate a USB camera (Logitech C310). The commands that use imagenet-camera function as expected, such as ./imagenet-camera googlenet.

A few days ago, the commands that use detectnet-camera, such as ./detectnet-camera multiped, were working too! However, I ran it again today and got the following error:

nvidia@tegra-ubuntu:/media/nvidia/SSD1TB/home/nvidia/nvidia_digits/jetson-inference/build/aarch64/bin$ ./detectnet-camera multiped
detectnet-camera
  args (2):  0 [./detectnet-camera]  1 [multiped]  

[gstreamer] initialized gstreamer, version 1.8.3.0
[gstreamer] gstreamer decoder pipeline string:
nvcamerasrc fpsRange="30.0 30.0" ! video/x-raw(memory:NVMM), width=(int)1280, height=(int)720, format=(string)NV12 ! nvvidconv flip-method=0 ! video/x-raw ! appsink name=mysink

detectnet-camera:  successfully initialized video device
    width:  1280
   height:  720
    depth:  12 (bpp)


detectNet -- loading detection network model from:
          -- prototxt    networks/multiped-500/deploy.prototxt
          -- model       networks/multiped-500/snapshot_iter_178000.caffemodel
          -- input_blob  'data'
          -- output_cvg  'coverage'
          -- output_bbox 'bboxes'
          -- mean_pixel  117.000000
          -- threshold   0.500000
          -- batch_size  2

[GIE]  TensorRT version 2.1, build 2102
[GIE]  attempting to open cache file networks/multiped-500/snapshot_iter_178000.caffemodel.2.tensorcache
[GIE]  loading network profile from cache... networks/multiped-500/snapshot_iter_178000.caffemodel.2.tensorcache
[GIE]  platform has FP16 support.
[GIE]  networks/multiped-500/snapshot_iter_178000.caffemodel loaded
[GIE]  CUDA engine context initialized with 3 bindings
[GIE]  networks/multiped-500/snapshot_iter_178000.caffemodel input  binding index:  0
[GIE]  networks/multiped-500/snapshot_iter_178000.caffemodel input  dims (b=2 c=3 h=512 w=1024) size=12582912
[cuda]  cudaAllocMapped 12582912 bytes, CPU 0x102a00000 GPU 0x102a00000
[GIE]  networks/multiped-500/snapshot_iter_178000.caffemodel output 0 coverage  binding index:  1
[GIE]  networks/multiped-500/snapshot_iter_178000.caffemodel output 0 coverage  dims (b=2 c=2 h=32 w=64) size=32768
[cuda]  cudaAllocMapped 32768 bytes, CPU 0x103600000 GPU 0x103600000
[GIE]  networks/multiped-500/snapshot_iter_178000.caffemodel output 1 bboxes  binding index:  2
[GIE]  networks/multiped-500/snapshot_iter_178000.caffemodel output 1 bboxes  dims (b=2 c=4 h=32 w=64) size=65536
[cuda]  cudaAllocMapped 65536 bytes, CPU 0x103608000 GPU 0x103608000
networks/multiped-500/snapshot_iter_178000.caffemodel initialized.
[cuda]  cudaAllocMapped 32 bytes, CPU 0x103800000 GPU 0x103800000
maximum bounding boxes:  8192
[cuda]  cudaAllocMapped 131072 bytes, CPU 0x103a00000 GPU 0x103a00000
[cuda]  cudaAllocMapped 65536 bytes, CPU 0x103618000 GPU 0x103618000
default X screen 0:   1920 x 1080
[OpenGL]  glDisplay display window initialized
[OpenGL]   creating 1280x720 texture
loaded image  fontmapA.png  (256 x 512)  2097152 bytes
[cuda]  cudaAllocMapped 2097152 bytes, CPU 0x103c00000 GPU 0x103c00000
[cuda]  cudaAllocMapped 8192 bytes, CPU 0x103e00000 GPU 0x103e00000
[gstreamer] gstreamer transitioning pipeline to GST_STATE_PLAYING
Socket read error. Camera Daemon stopped functioning.....
gst_nvcamera_open() failed ret=0
[gstreamer] gstreamer failed to set pipeline state to PLAYING (error 0)

detectnet-camera:  failed to open camera for streaming

I’m trying to pinpoint what might be going wrong…can you please help?

Hi pineapple_flora, can you check the entries under /dev/video* and see if the USB webcam is coming up under a different /dev/video* number? You can change that in the program with the DEFAULT_CAMERA #define. Have you restarted your system?

Hi dusty-nv,

Per your suggestions:

  1. I restarted the system
  2. The command ls /dev/video* yields just one result, /dev/video0
  3. I double-checked imagenet-camera.cpp to make sure #define DEFAULT_CAMERA was set correctly. Turns out that I had forgotten to also set (or save?) a similar definition in detectnet-camera.cpp.

It’s working now - thank you!