hello,
I get a error on the Jetson tx2 when trying to run an segmentation part of tutorial.
when I input :./segnet-console peds-001.jpg 001.jpg --model=networks/FCN-ResNet18-DeepScene-864x480/fcn_resnet18.onnx
error appears:
segNet – loading segmentation network model from:
– prototxt: (null)
– model: networks/FCN-ResNet18-DeepScene-864x480/fcn_resnet18.onnx
– labels: (null)
– colors: (null)
– input_blob ‘data’
– output_blob ‘score_fr_21classes’
– batch_size 1
[TRT] TensorRT version 5.0.6
[TRT] loading NVIDIA plugins…
[TRT] completed loading NVIDIA plugins.
[TRT] detected model format - ONNX (extension ‘.onnx’)
[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/FCN-ResNet18-DeepScene-864x480/fcn_resnet18.onnx.1.1.GPU.FP16.engine
[TRT] cache file not found, profiling network model on device GPU
[TRT] device GPU, loading /home/nvidia/kfr/DeepLearning/ImageRecognition/jetson-inference/build/aarch64/bin/ networks/FCN-ResNet18-DeepScene-864x480/fcn_resnet18.onnx
Input filename: networks/FCN-ResNet18-DeepScene-864x480/fcn_resnet18.onnx
ONNX IR version: 0.0.4
Opset version: 9
Producer name: pytorch
Producer version: 1.1
Domain:
Model version: 0
Doc string:
WARNING: ONNX model has a newer ir_version (0.0.4) than this parser was built against (0.0.3).
----- Parsing of ONNX model networks/FCN-ResNet18-DeepScene-864x480/fcn_resnet18.onnx is Done ----
[TRT] retrieved Input tensor “input_0”: 3x480x864
[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)
[TRT] device GPU, completed building CUDA engine
[TRT] network profiling complete, writing engine cache to networks/FCN-ResNet18-DeepScene-864x480/fcn_resnet18.onnx.1.1.GPU.FP16.engine
[TRT] device GPU, completed writing engine cache to networks/FCN-ResNet18-DeepScene-864x480/fcn_resnet18.onnx.1.1.GPU.FP16.engine
[TRT] device GPU, networks/FCN-ResNet18-DeepScene-864x480/fcn_resnet18.onnx loaded
[TRT] device GPU, CUDA engine context initialized with 2 bindings
[TRT] binding – index 0
– name ‘input_0’
– type FP32
– in/out INPUT
– # dims 3
– dim #0 3 (CHANNEL)
– dim #1 480 (SPATIAL)
– dim #2 864 (SPATIAL)
[TRT] binding – index 1
– name ‘output_0’
– type FP32
– in/out OUTPUT
– # dims 3
– dim #0 5 (CHANNEL)
– dim #1 15 (SPATIAL)
– dim #2 27 (SPATIAL)
[TRT] binding to input 0 data binding index: -1
[TRT] binding to input 0 data dims (b=1 c=0 h=0 w=0) size=0
[TRT] failed to alloc CUDA mapped memory for tensor input, 0 bytes
segNet – failed to initialize.
segnet-console: failed to initialize segnet
I appreciate any help out there.
Thanks.
Hi, since you specified the path to the model, you need to also specify the input and output layer names:
./segnet-console peds-001.jpg 001.jpg --model=networks/FCN-ResNet18-DeepScene-864x480/fcn_resnet18.onnx --input_blob=input_0 --output_blob=output_0
Or you can simply specify the shortcut to this model, “fcn-resnet18-deepscene-864x480”, and it will automatically know the layer names:
./segnet-console peds-001.jpg 001.jpg --model=fcn-resnet18-deepscene-864x480
See this table for the other shortcut names used with segnet, you don’t need to specify the path to the build-in models:
https://github.com/dusty-nv/jetson-inference/blob/master/docs/segnet-console-2.md#pre-trained-segmentation-models-available
hi,dusty_nv,When I try the second method:./segnet-console car1.jpeg car1resnet18_output.jpeg --network=fcn-resnet18-cityscapes-512x256 ,error appears:segnet-console: failed to initialize segnet
.
When I try the first method:./segnet-console peds-001.jpg 001.jpg --model=networks/FCN-ResNet18-MHP-640x360/fcn_resnet18.onnx --labels=networks/FCN-ResNet18-MHP-640x360/classes.txt --colors=networks/FCN-ResNet18-MHP-640x360/colors.txt --input_blob=input_0 --out_blob=output_0
He does not work either:segNet – loading segmentation network model from:
– prototxt: (null)
– model: networks/FCN-ResNet18-MHP-640x360/fcn_resnet18.onnx
– labels: networks/FCN-ResNet18-MHP-640x360/classes.txt
– colors: networks/FCN-ResNet18-MHP-640x360/colors.txt
– input_blob ‘input_0’
– output_blob ‘score_fr_21classes’
– batch_size 1
[TRT] TensorRT version 5.0.6
[TRT] loading NVIDIA plugins…
[TRT] completed loading NVIDIA plugins.
[TRT] detected model format - ONNX (extension ‘.onnx’)
[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/FCN-ResNet18-MHP-640x360/fcn_resnet18.onnx.1.1.GPU.FP16.engine
[TRT] cache file not found, profiling network model on device GPU
[TRT] device GPU, loading /home/nvidia/kfr/DeepLearning/ImageRecognition/jetson-inference/build/aarch64/bin/ networks/FCN-ResNet18-MHP-640x360/fcn_resnet18.onnx
Input filename: networks/FCN-ResNet18-MHP-640x360/fcn_resnet18.onnx
ONNX IR version: 0.0.4
Opset version: 9
Producer name: pytorch
Producer version: 1.1
Domain:
Model version: 0
Doc string:
WARNING: ONNX model has a newer ir_version (0.0.4) than this parser was built against (0.0.3).
----- Parsing of ONNX model networks/FCN-ResNet18-MHP-640x360/fcn_resnet18.onnx is Done ----
[TRT] retrieved Input tensor “input_0”: 3x360x640
[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)
[TRT] device GPU, completed building CUDA engine
[TRT] network profiling complete, writing engine cache to networks/FCN-ResNet18-MHP-640x360/fcn_resnet18.onnx.1.1.GPU.FP16.engine
[TRT] device GPU, completed writing engine cache to networks/FCN-ResNet18-MHP-640x360/fcn_resnet18.onnx.1.1.GPU.FP16.engine
[TRT] device GPU, networks/FCN-ResNet18-MHP-640x360/fcn_resnet18.onnx loaded
[TRT] device GPU, CUDA engine context initialized with 2 bindings
[TRT] binding – index 0
– name ‘input_0’
– type FP32
– in/out INPUT
– # dims 3
– dim #0 3 (CHANNEL)
– dim #1 360 (SPATIAL)
– dim #2 640 (SPATIAL)
[TRT] binding – index 1
– name ‘output_0’
– type FP32
– in/out OUTPUT
– # dims 3
– dim #0 21 (CHANNEL)
– dim #1 12 (SPATIAL)
– dim #2 20 (SPATIAL)
[TRT] binding to input 0 input_0 binding index: 0
[TRT] binding to input 0 input_0 dims (b=1 c=3 h=360 w=640) size=2764800
[TRT] binding to output 0 score_fr_21classes binding index: -1
[TRT] binding to output 0 score_fr_21classes dims (b=1 c=0 h=0 w=0) size=0
[TRT] failed to alloc CUDA mapped memory for tensor output, 0 bytes
segNet – failed to initialize.
segnet-console: failed to initialize segnet
All models are placed inside the networks like this:
nvidia@nvidia:~/kfr/DeepLearning/ImageRecognition/jetson-inference/data/networks$ ll
total 166276
drwxr-xr-x 23 nvidia nvidia 4096 Oct 18 08:54 ./
drwxr-xr-x 4 nvidia nvidia 4096 Sep 23 23:02 …/
drwxr-xr-x 2 nvidia nvidia 4096 Oct 17 04:19 20191016-145253-52f9_epoch_30.0/
-rw-r–r-- 1 nvidia nvidia 53533754 Jun 18 13:57 bvlc_googlenet.caffemodel
-rw-r–r-- 1 nvidia nvidia 17797624 Oct 17 21:03 bvlc_googlenet.caffemodel.1.1.GPU.FP16.engine
-rw-rw-r-- 1 nvidia nvidia 159 Aug 16 14:44 classes.txt
-rw-r–r-- 1 nvidia nvidia 229 Sep 4 15:18 colors.txt
drwxrwxr-x 2 nvidia nvidia 4096 Oct 17 22:44 DetectNet-COCO-Airplane/
drwxrwxr-x 2 nvidia nvidia 4096 Oct 14 23:43 DetectNet-COCO-Bottle/
drwxrwxr-x 2 nvidia nvidia 4096 Oct 14 23:15 DetectNet-COCO-Dog/
drwxrwxr-x 2 nvidia nvidia 4096 Sep 24 23:48 facenet-120/
drwxrwxr-x 2 nvidia nvidia 4096 Oct 17 04:08 FCN-Alexnet-Aerial-FPV-720p/
drwxrwxr-x 2 nvidia nvidia 4096 Oct 17 23:05 FCN-Alexnet-Cityscapes-HD/
drwxrwxr-x 2 nvidia nvidia 4096 Oct 17 05:49 FCN-Alexnet-Cityscapes-SD/
drwxrwxr-x 2 nvidia nvidia 4096 Oct 18 04:04 FCN-Alexnet-Pascal-VOC/
drwxrwxr-x 2 nvidia nvidia 4096 Oct 17 23:16 FCN-Alexnet-SYNTHIA-Summer-HD/
drwxrwxr-x 2 nvidia nvidia 4096 Sep 4 15:29 FCN-ResNet18-Cityscapes-1024x512/
drwxrwxr-x 2 nvidia nvidia 4096 Oct 18 07:29 FCN-ResNet18-Cityscapes-2048x1024/
drwxrwxr-x 2 nvidia nvidia 4096 Oct 18 21:18 FCN-ResNet18-Cityscapes-512x256/
drwxrwxr-x 2 nvidia nvidia 4096 Sep 16 13:23 FCN-ResNet18-DeepScene-576x320/
drwxrwxr-x 2 nvidia nvidia 4096 Oct 18 08:44 FCN-ResNet18-DeepScene-864x480/
drwxrwxr-x 2 nvidia nvidia 4096 Oct 18 21:15 FCN-ResNet18-MHP-640x360/
drwxr-xr-x 3 nvidia nvidia 4096 Oct 18 07:14 ‘FCN-ResNet18-MHP-640x360 (1)’/
-rw-rw-r-- 1 nvidia nvidia 47137244 Aug 21 13:33 fcn_resnet18.onnx
-rw-r–r-- 1 nvidia nvidia 51577848 Oct 18 07:02 fcn_resnet18.onnx.1.1.GPU.FP16.engine
drwxrwxr-x 2 nvidia nvidia 4096 Aug 30 14:44 FCN-ResNet18-SUN-RGBD-640x512/
drwxr-xr-x 3 nvidia nvidia 4096 Oct 18 07:14 ‘FCN-ResNet18-SUN-RGBD-640x512 (1)’/
drwxr-xr-x 2 nvidia nvidia 4096 Oct 17 21:11 GoogleNet/
-rw-r–r-- 1 nvidia nvidia 35776 Jun 18 13:57 googlenet_noprob.prototxt
-rw-r–r-- 1 nvidia nvidia 35861 Jun 18 13:57 googlenet.prototxt
-rw-r–r-- 1 nvidia nvidia 31675 Jun 18 13:53 ilsvrc12_synset_words.txt
what I should do now?Thanks for your help.
when I input this:./segnet-console --model=fcn-resnet18-cityscapes peds-001.jpg output.jpg
Displayed on the screen:
segNet – loading segmentation network model from:
– prototxt: (null)
– model: fcn-resnet18-cityscapes
– labels: (null)
– colors: (null)
– input_blob ‘data’
– output_blob ‘score_fr_21classes’
– batch_size 1
[TRT] TensorRT version 5.0.6
[TRT] loading NVIDIA plugins…
[TRT] completed loading NVIDIA plugins.
[TRT] detected model format - custom (extension ‘.fcn-resnet18-cityscapes’)
[TRT] model format ‘custom’ not supported by jetson-inference
segNet – failed to initialize.
segnet-console: failed to initialize segnet
hi,dusty。I solved this problem by recompiling the project and the results look pretty good.
Thanks for your help.
OK thanks, glad you got it working. Just FYI, I noticed in the command you posted above you used --out-blob (when it should be --output-blob), so that is why it may not have been working at the time:
# --out_blob incorrect
./segnet-console peds-001.jpg 001.jpg --model=networks/FCN-ResNet18-MHP-640x360/fcn_resnet18.onnx --labels=networks/FCN-ResNet18-MHP-640x360/classes.txt --colors=networks/FCN-ResNet18-MHP-640x360/colors.txt --input_blob=input_0 --out_blob=output_0
# should have been --output_blob=output_0
./segnet-console peds-001.jpg 001.jpg --model=networks/FCN-ResNet18-MHP-640x360/fcn_resnet18.onnx --labels=networks/FCN-ResNet18-MHP-640x360/classes.txt --colors=networks/FCN-ResNet18-MHP-640x360/colors.txt --input_blob=input_0 --output_blob=output_0