Hello AI World, jetson-inference, Classifying Images with ImageNet: imageNet -- failed to initialize

Hello- I’m stuck and could really use some help getting through this…

I have attempted multiple times to go through Classifying Images with ImageNet, and I keep getting the same error(s).

I followed the instructions and am running from the docker. I have also cloned the github a few times in case something was wrong there, but still, same thing.

I also attempted using the Model Downloader tool as the output suggested, still no success. (I thought I read this was no longer necessary anyways?)

I attempted running with the default googlenet, and attempted also with resnet-18 (see below)

root@xxxx:/jetson-inference/build/aarch64/bin# ./imagenet.py --network=resnet-18 images/jellyfish.jpg images/test/output_jellyfish.jpg

[TRT] downloading model ResNet-18.tar.gz…
cd networks ; wget --quiet --show-progress --progress=bar:force:noscroll --no-check-certificate https://nvidia.box.com/shared/static/gph1qfor89vh498op8cicvwc13zltu3h.gz -O ResNet-18.tar.gz ; tar -xzvf ResNet-18.tar.gz ; rm ResNet-18.tar.gz

gzip: stdin: unexpected end of file
tar: Child returned status 1
tar: Error is not recoverable: exiting now
[TRT] downloaded model ResNet-18.tar.gz

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

[TRT] TensorRT version 8.5.2
[TRT] loading NVIDIA plugins…
[TRT] Registered plugin creator - ::BatchedNMSDynamic_TRT version 1
[TRT] Registered plugin creator - ::BatchedNMS_TRT version 1
[TRT] Registered plugin creator - ::BatchTilePlugin_TRT version 1
[TRT] Registered plugin creator - ::Clip_TRT version 1
[TRT] Registered plugin creator - ::CoordConvAC version 1
[TRT] Registered plugin creator - ::CropAndResizeDynamic version 1
[TRT] Registered plugin creator - ::CropAndResize version 1
[TRT] Registered plugin creator - ::DecodeBbox3DPlugin version 1
[TRT] Registered plugin creator - ::DetectionLayer_TRT version 1
[TRT] Registered plugin creator - ::EfficientNMS_Explicit_TF_TRT version 1
[TRT] Registered plugin creator - ::EfficientNMS_Implicit_TF_TRT version 1
[TRT] Registered plugin creator - ::EfficientNMS_ONNX_TRT version 1
[TRT] Registered plugin creator - ::EfficientNMS_TRT version 1
[TRT] Could not register plugin creator - ::FlattenConcat_TRT version 1
[TRT] Registered plugin creator - ::GenerateDetection_TRT version 1
[TRT] Registered plugin creator - ::GridAnchor_TRT version 1
[TRT] Registered plugin creator - ::GridAnchorRect_TRT version 1
[TRT] Registered plugin creator - ::GroupNorm version 1
[TRT] Registered plugin creator - ::InstanceNormalization_TRT version 1
[TRT] Registered plugin creator - ::InstanceNormalization_TRT version 2
[TRT] Registered plugin creator - ::LayerNorm version 1
[TRT] Registered plugin creator - ::LReLU_TRT version 1
[TRT] Registered plugin creator - ::MultilevelCropAndResize_TRT version 1
[TRT] Registered plugin creator - ::MultilevelProposeROI_TRT version 1
[TRT] Registered plugin creator - ::MultiscaleDeformableAttnPlugin_TRT version 1
[TRT] Registered plugin creator - ::NMSDynamic_TRT version 1
[TRT] Registered plugin creator - ::NMS_TRT version 1
[TRT] Registered plugin creator - ::Normalize_TRT version 1
[TRT] Registered plugin creator - ::PillarScatterPlugin version 1
[TRT] Registered plugin creator - ::PriorBox_TRT version 1
[TRT] Registered plugin creator - ::ProposalDynamic version 1
[TRT] Registered plugin creator - ::ProposalLayer_TRT version 1
[TRT] Registered plugin creator - ::Proposal version 1
[TRT] Registered plugin creator - ::PyramidROIAlign_TRT version 1
[TRT] Registered plugin creator - ::Region_TRT version 1
[TRT] Registered plugin creator - ::Reorg_TRT version 1
[TRT] Registered plugin creator - ::ResizeNearest_TRT version 1
[TRT] Registered plugin creator - ::ROIAlign_TRT version 1
[TRT] Registered plugin creator - ::RPROI_TRT version 1
[TRT] Registered plugin creator - ::ScatterND version 1
[TRT] Registered plugin creator - ::SeqLen2Spatial version 1
[TRT] Registered plugin creator - ::SpecialSlice_TRT version 1
[TRT] Registered plugin creator - ::SplitGeLU version 1
[TRT] Registered plugin creator - ::Split version 1
[TRT] Registered plugin creator - ::VoxelGeneratorPlugin version 1
[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] [MemUsageChange] Init CUDA: CPU +221, GPU +0, now: CPU 253, GPU 6838 (MiB)
[TRT] Trying to load shared library libnvinfer_builder_resource.so.8.5.2
[TRT] Loaded shared library libnvinfer_builder_resource.so.8.5.2
[TRT] [MemUsageChange] Init builder kernel library: CPU +303, GPU +285, now: CPU 578, GPU 7143 (MiB)
[TRT] native precisions detected for GPU: FP32, FP16, INT8
[TRT] selecting fastest native precision for GPU: FP16
[TRT] could not find engine cache .1.1.8502.GPU.FP16.engine
[TRT] cache file invalid, profiling network model on device GPU

error: model file ‘networks/ResNet-18/ResNet-18.caffemodel’ was not found.
if loading a built-in model, maybe it wasn’t downloaded before.

    Run the Model Downloader tool again and select it for download:

       $ cd <jetson-inference>/tools
       $ ./download-models.sh

[TRT] failed to load networks/ResNet-18/ResNet-18.caffemodel
[TRT] imageNet – failed to initialize.
Traceback (most recent call last):
File “./imagenet.py”, line 51, in
net = imageNet(args.network, sys.argv)
Exception: jetson.inference – imageNet failed to load network

Hi @SMB you are correct that the Model Downloader tool is no longer necessary to use and the models are downloaded automatically for you on-demand - however it appears that it encountered an error with the network connection while it was trying to download the model.

If it keeps happening, it may be that your network or filewall is blocking access to the site where I host the models. In that case, please try downloading/extracting them manually from here:

1 Like

Hi Dusty, thank you so much for the response.

I downloaded “GoogleNet.tar.gz” from the Download Mirror you referenced, and extracted accordingly. I put the model into the container. However I am still having problems running the small inference case. It’s like it sees the model, but can’t open it. For lack of other ideas, I changed the permissions (chmod 755), but same results.

root@xxxx:/jetson-inference/build/aarch64/bin# ./imagenet.py images/orange_0.jpg images/test/output_0.jpg

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

[TRT] TensorRT version 8.5.2
[TRT] loading NVIDIA plugins…
[TRT] Registered plugin creator - ::BatchedNMSDynamic_TRT version 1
[TRT] Registered plugin creator - ::BatchedNMS_TRT version 1
[TRT] Registered plugin creator - ::BatchTilePlugin_TRT version 1
[TRT] Registered plugin creator - ::Clip_TRT version 1
[TRT] Registered plugin creator - ::CoordConvAC version 1
[TRT] Registered plugin creator - ::CropAndResizeDynamic version 1
[TRT] Registered plugin creator - ::CropAndResize version 1
[TRT] Registered plugin creator - ::DecodeBbox3DPlugin version 1
[TRT] Registered plugin creator - ::DetectionLayer_TRT version 1
[TRT] Registered plugin creator - ::EfficientNMS_Explicit_TF_TRT version 1
[TRT] Registered plugin creator - ::EfficientNMS_Implicit_TF_TRT version 1
[TRT] Registered plugin creator - ::EfficientNMS_ONNX_TRT version 1
[TRT] Registered plugin creator - ::EfficientNMS_TRT version 1
[TRT] Could not register plugin creator - ::FlattenConcat_TRT version 1
[TRT] Registered plugin creator - ::GenerateDetection_TRT version 1
[TRT] Registered plugin creator - ::GridAnchor_TRT version 1
[TRT] Registered plugin creator - ::GridAnchorRect_TRT version 1
[TRT] Registered plugin creator - ::GroupNorm version 1
[TRT] Registered plugin creator - ::InstanceNormalization_TRT version 1
[TRT] Registered plugin creator - ::InstanceNormalization_TRT version 2
[TRT] Registered plugin creator - ::LayerNorm version 1
[TRT] Registered plugin creator - ::LReLU_TRT version 1
[TRT] Registered plugin creator - ::MultilevelCropAndResize_TRT version 1
[TRT] Registered plugin creator - ::MultilevelProposeROI_TRT version 1
[TRT] Registered plugin creator - ::MultiscaleDeformableAttnPlugin_TRT version 1
[TRT] Registered plugin creator - ::NMSDynamic_TRT version 1
[TRT] Registered plugin creator - ::NMS_TRT version 1
[TRT] Registered plugin creator - ::Normalize_TRT version 1
[TRT] Registered plugin creator - ::PillarScatterPlugin version 1
[TRT] Registered plugin creator - ::PriorBox_TRT version 1
[TRT] Registered plugin creator - ::ProposalDynamic version 1
[TRT] Registered plugin creator - ::ProposalLayer_TRT version 1
[TRT] Registered plugin creator - ::Proposal version 1
[TRT] Registered plugin creator - ::PyramidROIAlign_TRT version 1
[TRT] Registered plugin creator - ::Region_TRT version 1
[TRT] Registered plugin creator - ::Reorg_TRT version 1
[TRT] Registered plugin creator - ::ResizeNearest_TRT version 1
[TRT] Registered plugin creator - ::ROIAlign_TRT version 1
[TRT] Registered plugin creator - ::RPROI_TRT version 1
[TRT] Registered plugin creator - ::ScatterND version 1
[TRT] Registered plugin creator - ::SeqLen2Spatial version 1
[TRT] Registered plugin creator - ::SpecialSlice_TRT version 1
[TRT] Registered plugin creator - ::SplitGeLU version 1
[TRT] Registered plugin creator - ::Split version 1
[TRT] Registered plugin creator - ::VoxelGeneratorPlugin version 1
[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] [MemUsageChange] Init CUDA: CPU +221, GPU +0, now: CPU 253, GPU 6883 (MiB)
[TRT] Trying to load shared library libnvinfer_builder_resource.so.8.5.2
[TRT] Loaded shared library libnvinfer_builder_resource.so.8.5.2
[TRT] [MemUsageChange] Init builder kernel library: CPU +303, GPU +286, now: CPU 578, GPU 7190 (MiB)
[TRT] native precisions detected for GPU: FP32, FP16, INT8
[TRT] selecting fastest native precision for GPU: FP16
[TRT] could not find engine cache networks/Googlenet/bvlc_googlenet.caffemodel.1.1.8502.GPU.FP16.engine
[TRT] cache file invalid, profiling network model on device GPU
[TRT] [MemUsageChange] Init CUDA: CPU +0, GPU +0, now: CPU 283, GPU 7190 (MiB)
[TRT] Trying to load shared library libnvinfer_builder_resource.so.8.5.2
[TRT] Loaded shared library libnvinfer_builder_resource.so.8.5.2
[TRT] [MemUsageChange] Init builder kernel library: CPU +296, GPU +2, now: CPU 579, GPU 7192 (MiB)
[TRT] The implicit batch dimension mode has been deprecated. Please create the network with NetworkDefinitionCreationFlag::kEXPLICIT_BATCH flag whenever possible.
[TRT] device GPU, loading networks/Googlenet/bvlc_googlenet.caffemodel
[TRT] CaffeParser: Could not open file
[TRT] CaffeParser: Could not parse deploy file
[TRT] device GPU, failed to parse caffe network
[TRT] device GPU, failed to load networks/Googlenet/bvlc_googlenet.caffemodel
[TRT] failed to load networks/Googlenet/bvlc_googlenet.caffemodel
[TRT] imageNet – failed to initialize.
Traceback (most recent call last):
File “./imagenet.py”, line 51, in
net = imageNet(args.network, sys.argv)
Exception: jetson.inference – imageNet failed to load network

Hi @SMB, it still can’t find the model to where you extracted it to. Outside of container, it should be found under your jetson-inference repo at jetson-inference/data/networks/Googlenet/bvlc_googlenet.caffemodel (this gets data directory gets mounted into the container from your device)

Thank you Dusty-
It is functioning as it should now

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.