Segmentation fault (core dumped) when running imagenet-camera on Jetson TX2

Hello,

I’m getting a Segmentation fault when running imagenet-camera or imagenet-console.

Camera works with nvgtcapture or the Jetpack nvgtcamera_capture demo.

Looks like it not finding the engine cache files??

Thanks,
Best Regards

=========================================================================
$ ./imagenet-camera googlenet
imagenet-camera
args (2): 0 [./imagenet-camera] 1 [googlenet]

[gstreamer] initialized gstreamer, version 1.14.1.0
[gstreamer] gstCamera attempting to initialize with GST_SOURCE_NVCAMERA
[gstreamer] gstCamera 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=2 ! video/x-raw ! appsink name=mysink
[gstreamer] gstCamera failed to create pipeline
[gstreamer] (no element “nvcamerasrc”)
[gstreamer] failed to init gstCamera (GST_SOURCE_NVCAMERA)
[gstreamer] gstCamera attempting to initialize with GST_SOURCE_NVARGUS
[gstreamer] gstCamera pipeline string:
nvarguscamerasrc ! video/x-raw(memory:NVMM), width=(int)1280, height=(int)720, framerate=30/1, format=(string)NV12 ! nvvidconv flip-method=2 ! video/x-raw ! appsink name=mysink
[gstreamer] gstCamera successfully initialized with GST_SOURCE_NVARGUS

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

imageNet – loading classification network model from:
– prototxt networks/googlenet.prototxt
– model networks/bvlc_googlenet.caffemodel
– class_labels networks/ilsvrc12_synset_words.txt
– input_blob ‘data’
– output_blob ‘prob’
– batch_size 2

[TRT] TensorRT version 5.0.6
[TRT] detected model format - caffe (extension ‘.caffemodel’)
[TRT] desired precision specified for GPU: FASTEST
[TRT] requested fasted precision for device GPU without providing valid calibrator, disabling INT8
[TRT] native precisions detected for GPU: FP32, FP16
[TRT] selecting fastest native precision for GPU: FP16
[TRT] attempting to open engine cache file networks/bvlc_googlenet.caffemodel.2.1.GPU.FP16.engine
[TRT] cache file not found, profiling network model on device GPU
[TRT] device GPU, loading networks/googlenet.prototxt networks/bvlc_googlenet.caffemodel
[TRT] failed to retrieve tensor for Output “prob”
[TRT] device GPU, configuring CUDA engine
[TRT] device GPU, building FP16: ON
[TRT] device GPU, building INT8: OFF
[TRT] device GPU, building CUDA engine (this may take a few minutes the first time a network is loaded)
Segmentation fault (core dumped)

===========================================================================
$ ./imagenet-console orange_0.jpg output_0.jpg
imagenet-console
args (3): 0 [./imagenet-console] 1 [orange_0.jpg] 2 [output_0.jpg]

imageNet – loading classification network model from:
– prototxt networks/googlenet.prototxt
– model networks/bvlc_googlenet.caffemodel
– class_labels networks/ilsvrc12_synset_words.txt
– input_blob ‘data’
– output_blob ‘prob’
– batch_size 2

[TRT] TensorRT version 5.0.6
[TRT] detected model format - caffe (extension ‘.caffemodel’)
[TRT] desired precision specified for GPU: FASTEST
[TRT] requested fasted precision for device GPU without providing valid calibrator, disabling INT8
[TRT] native precisions detected for GPU: FP32, FP16
[TRT] selecting fastest native precision for GPU: FP16
[TRT] attempting to open engine cache file networks/bvlc_googlenet.caffemodel.2.1.GPU.FP16.engine
[TRT] cache file not found, profiling network model on device GPU
[TRT] device GPU, loading networks/googlenet.prototxt networks/bvlc_googlenet.caffemodel
[TRT] failed to retrieve tensor for Output “prob”
[TRT] device GPU, configuring CUDA engine
[TRT] device GPU, building FP16: ON
[TRT] device GPU, building INT8: OFF
[TRT] device GPU, building CUDA engine (this may take a few minutes the first time a network is loaded)
Segmentation fault (core dumped)

Hi,

The error occurs when converting the model into TensorRT format.
Could you redownload the model with this comment and try it again?
[url]https://devtalk.nvidia.com/default/topic/1049144/jetson-nano/imagenet-console-application-not-working-properly/post/5328776/#5328776[/url]

Thanks

Hello AastaLLL,

First, thank you for your help. I followed the redownload instructions, rebuilt and got the same “Segmentation fault (core dumped)” error. The listing is the same as listed above and the same as what bys724 listed in the “imagenet-console application not working properly” forum entry.

I am in the US (east coast), but interestingly enough my company’s firewall blocks box.com. Downloading using the link executed okay, but I’m still getting the error.

Also, I used the SDKManager to build the image on my Jetson TX2.

Best Regards

===========================================================================

$ wget https://raw.githubusercontent.com/BVLC/caffe/master/models/bvlc_googlenet/deploy.prototxt -O googlenet.prototxt
–2019-06-19 08:24:38-- https://raw.githubusercontent.com/BVLC/caffe/master/models/bvlc_googlenet/deploy.prototxt
Resolving raw.githubusercontent.com (raw.githubusercontent.com)… 151.101.192.133, 151.101.64.133, 151.101.0.133, …
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|151.101.192.133|:443… connected.
HTTP request sent, awaiting response… 200 OK
Length: 35862 (35K) [text/plain]
Saving to: ‘googlenet.prototxt’

googlenet.prototxt 100%[===================>] 35.02K --.-KB/s in 0.1s

2019-06-19 08:24:39 (346 KB/s) - ‘googlenet.prototxt’ saved [35862/35862]

$ wget http://dl.caffe.berkeleyvision.org/bvlc_googlenet.caffemodel -O bvlc_googlenet.caffemodel
–2019-06-19 08:25:26-- http://dl.caffe.berkeleyvision.org/bvlc_googlenet.caffemodel
Resolving dl.caffe.berkeleyvision.org (dl.caffe.berkeleyvision.org)… 169.229.222.251
Connecting to dl.caffe.berkeleyvision.org (dl.caffe.berkeleyvision.org)|169.229.222.251|:80… connected.
HTTP request sent, awaiting response… 200 OK
Length: 53533754 (51M) [application/octet-stream]
Saving to: ‘bvlc_googlenet.caffemodel’

bvlc_googlenet.caffemodel 100%[================================================>] 51.05M 1005KB/s in 53s

2019-06-19 08:26:22 (993 KB/s) - ‘bvlc_googlenet.caffemodel’ saved [53533754/53533754]

Can you run the imagenet-console application OK?

BTW here is a mirror of all the models on GitHub: [b][url]https://github.com/dusty-nv/jetson-inference/releases[/url][/b]

Hi dusty_nv,

No, I get the same problem.

Here’s the listing:

$ ./imagenet-console orange_0.jpg output_0.jpg
imagenet-console
args (3): 0 [./imagenet-console] 1 [orange_0.jpg] 2 [output_0.jpg]

imageNet – loading classification network model from:
– prototxt networks/googlenet.prototxt
– model networks/bvlc_googlenet.caffemodel
– class_labels networks/ilsvrc12_synset_words.txt
– input_blob ‘data’
– output_blob ‘prob’
– batch_size 2

[TRT] TensorRT version 5.0.6
[TRT] detected model format - caffe (extension ‘.caffemodel’)
[TRT] desired precision specified for GPU: FASTEST
[TRT] requested fasted precision for device GPU without providing valid calibrator, disabling INT8
[TRT] native precisions detected for GPU: FP32, FP16
[TRT] selecting fastest native precision for GPU: FP16
[TRT] attempting to open engine cache file networks/bvlc_googlenet.caffemodel.2.1.GPU.FP16.engine
[TRT] cache file not found, profiling network model on device GPU
[TRT] device GPU, loading networks/googlenet.prototxt networks/bvlc_googlenet.caffemodel
[TRT] failed to retrieve tensor for Output “prob”
[TRT] device GPU, configuring CUDA engine
[TRT] device GPU, building FP16: ON
[TRT] device GPU, building INT8: OFF
[TRT] device GPU, building CUDA engine (this may take a few minutes the first time a network is loaded)
Segmentation fault (core dumped)

Before the segfault, it says: "failed to retrieve tensor for Output “prob”

This means that the caffemodel is corrupted, or there is something wrong with the protobuf library.

Can you try using the alexnet model instead? If you keep having issue, I would try re-flashing and installing jetson-inference first, to avoid any issue with protobuf being upgraded.

Looks like they are both empty.
Is that correct?

Human#68@TX2-desktop:/usr/local/bin/networks$ ls -la
total 84
drwxr-xr-x 2 Human#68 Human#68 4096 Jun 19 08:29 .
drwxr-xr-x 4 Human#68 Human#68 4096 Jun 17 16:44 …
-rw-r–r-- 1 Human#68 Human#68 0 Jun 19 08:29 alexnet_noprob.prototxt
-rw-r–r-- 1 Human#68 Human#68 0 Jun 19 08:29 alexnet.prototxt
-rw-r–r-- 1 Human#68 Human#68 0 Jun 19 08:29 bvlc_alexnet.caffemodel
-rw-r–r-- 1 Human#68 Human#68 0 Jun 19 08:29 bvlc_googlenet.caffemodel
-rw-r–r-- 1 Human#68 Human#68 42924 Jun 17 16:44 detectnet.prototxt
-rw-r–r-- 1 Human#68 Human#68 0 Jun 19 08:29 googlenet_noprob.prototxt
-rw-r–r-- 1 Human#68 Human#68 0 Jun 19 08:29 googlenet.prototxt
-rw-r–r-- 1 Human#68 Human#68 31675 Jun 17 16:44 ilsvrc12_synset_words.txt

Also, how do I tell .imagenet to use the alexnet model?

SOLVED!

So I downloaded the caffemodels from [url]https://github.com/dusty-nv/jetson-inference/releases[/url] and it worked.

Camera is inverted, but working.

Thank you for your help!

Best Regards

Glad that you were able to get it going. To invert the camera, try changing the flip-method parameter here and recompiling:

https://github.com/dusty-nv/jetson-utils/blob/2fb2b9dfd8323f99c22d3e2755b88345abd2f3a8/camera/gstCamera.cpp#L347

I seem to be running into a similar issue with the seg. fault. I tried downloading GoogleNet from the above link, unzipped and ran $make and $sudo make install. I am still getting the fault. Any other ideas? I also have Logitech C270.

aero-desktop:~/jetson-inference/build/aarch64/bin$ ./imagenet-camera googlenet
[gstreamer] initialized gstreamer, version 1.14.5.0
[gstreamer] gstCamera attempting to initialize with GST_SOURCE_NVARGUS, camera 0
[gstreamer] gstCamera pipeline string:
nvarguscamerasrc sensor-id=0 ! video/x-raw(memory:NVMM), width=(int)1280, height=(int)720, framerate=30/1, format=(string)NV12 ! nvvidconv flip-method=2 ! video/x-raw ! appsink name=mysink
[gstreamer] gstCamera successfully initialized with GST_SOURCE_NVARGUS, camera 0

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

imageNet – loading classification network model from:
– prototxt networks/googlenet.prototxt
– model networks/bvlc_googlenet.caffemodel
– class_labels networks/ilsvrc12_synset_words.txt
– input_blob ‘data’
– output_blob ‘prob’
– batch_size 1

[TRT] TensorRT version 6.0.1
[TRT] loading NVIDIA plugins…
[TRT] Plugin Creator registration succeeded - GridAnchor_TRT
[TRT] Plugin Creator registration succeeded - GridAnchorRect_TRT
[TRT] Plugin Creator registration succeeded - NMS_TRT
[TRT] Plugin Creator registration succeeded - Reorg_TRT
[TRT] Plugin Creator registration succeeded - Region_TRT
[TRT] Plugin Creator registration succeeded - Clip_TRT
[TRT] Plugin Creator registration succeeded - LReLU_TRT
[TRT] Plugin Creator registration succeeded - PriorBox_TRT
[TRT] Plugin Creator registration succeeded - Normalize_TRT
[TRT] Plugin Creator registration succeeded - RPROI_TRT
[TRT] Plugin Creator registration succeeded - BatchedNMS_TRT
[TRT] Could not register plugin creator: FlattenConcat_TRT in namespace:
[TRT] completed loading NVIDIA plugins.
[TRT] detected model format - caffe (extension ‘.caffemodel’)
[TRT] desired precision specified for GPU: FASTEST
[TRT] requested fasted precision for device GPU without providing valid calibrator, disabling INT8
[TRT] native precisions detected for GPU: FP32, FP16
[TRT] selecting fastest native precision for GPU: FP16
[TRT] attempting to open engine cache file networks/bvlc_googlenet.caffemodel.1.1.GPU.FP16.engine
[TRT] loading network profile from engine cache… networks/bvlc_googlenet.caffemodel.1.1.GPU.FP16.engine
[TRT] device GPU, networks/bvlc_googlenet.caffemodel loaded
[TRT] Deserialize required 3493133 microseconds.
[TRT] device GPU, CUDA engine context initialized with 2 bindings
[TRT] binding – index 0
– name ‘data’
– type FP32
– in/out INPUT
– # dims 3
– dim #0 3 (SPATIAL)
– dim #1 224 (SPATIAL)
– dim #2 224 (SPATIAL)
[TRT] binding – index 1
– name ‘prob’
– type FP32
– in/out OUTPUT
– # dims 3
– dim #0 1000 (SPATIAL)
– dim #1 1 (SPATIAL)
– dim #2 1 (SPATIAL)
[TRT] binding to input 0 data binding index: 0
[TRT] binding to input 0 data dims (b=1 c=3 h=224 w=224) size=602112
[TRT] binding to output 0 prob binding index: 1
[TRT] binding to output 0 prob dims (b=1 c=1000 h=1 w=1) size=4000
device GPU, networks/bvlc_googlenet.caffemodel initialized.
[TRT] networks/bvlc_googlenet.caffemodel loaded
imageNet – loaded 1000 class info entries
networks/bvlc_googlenet.caffemodel initialized.
[OpenGL] glDisplay – X screen 0 resolution: 1920x1080
[OpenGL] glDisplay – display device initialized
[gstreamer] opening gstCamera for streaming, transitioning pipeline to GST_STATE_PLAYING
[gstreamer] gstreamer changed state from NULL to READY ==> mysink
[gstreamer] gstreamer changed state from NULL to READY ==> capsfilter1
[gstreamer] gstreamer changed state from NULL to READY ==> nvvconv0
[gstreamer] gstreamer changed state from NULL to READY ==> capsfilter0
[gstreamer] gstreamer changed state from NULL to READY ==> nvarguscamerasrc0
[gstreamer] gstreamer changed state from NULL to READY ==> pipeline0
[gstreamer] gstreamer changed state from READY to PAUSED ==> capsfilter1
[gstreamer] gstreamer changed state from READY to PAUSED ==> nvvconv0
[gstreamer] gstreamer changed state from READY to PAUSED ==> capsfilter0
[gstreamer] gstreamer stream status CREATE ==> src
[gstreamer] gstreamer changed state from READY to PAUSED ==> nvarguscamerasrc0
[gstreamer] gstreamer changed state from READY to PAUSED ==> pipeline0
[gstreamer] gstreamer msg new-clock ==> pipeline0
[gstreamer] gstreamer changed state from PAUSED to PLAYING ==> capsfilter1
[gstreamer] gstreamer changed state from PAUSED to PLAYING ==> nvvconv0
[gstreamer] gstreamer changed state from PAUSED to PLAYING ==> capsfilter0
[gstreamer] gstreamer changed state from PAUSED to PLAYING ==> nvarguscamerasrc0
[gstreamer] gstreamer stream status ENTER ==> src
[gstreamer] gstreamer msg stream-start ==> pipeline0

imagenet-camera: camera open for streaming
GST_ARGUS: Creating output stream
CONSUMER: Waiting until producer is connected…
GST_ARGUS: Available Sensor modes :
Segmentation fault (core dumped)

Hi nicholas_d_k,

Please open a new topic for your issue. Thanks