Hello AI World - Processing Images with Tensor RT

I was on the Re-training on the Cat/Dog Dataset in the Hello AI World course, and I made sure that I did everything right. However, when I got to the testing portion, it would return an error.

This is what I inputted.
imagenet.py --model=$models/cat_dog/resnet18.onnx --input_blob=input_0 --output_blob=output_0 --labels=$data/cat_dog/labels.txt $data/cat_dog/test/cat/01.jpg cat.jpg

This is what I got.
error: model file ‘/cat_dog/resnet18.onnx’ 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 /cat_dog/resnet18.onnx
[TRT] imageNet – failed to initialize.
jetson.inference – imageNet failed to load built-in network ‘googlenet’
Traceback (most recent call last):
File “/usr/local/bin/imagenet.py”, line 55, in
net = jetson.inference.imageNet(opt.network, sys.argv)
Exception: jetson.inference – imageNet failed to load network

Hi,

Is your model available in /cat_dog/resnet18.onnx?
Please check if you need to remove the "/"cat_… for a correct model path.

Thanks.

Yes I made sure the path was correct, and I looked in the directory, and I saw the model file.

Hi @a_mac_user, what’s the current working directory of your terminal, and also what paths are stored in $model and $data?

echo $model
echo $data

You may just need to remove the $ symbol from in front of those if you are actually meaning to use the path models/cat_dog/resnet18_onnx and data/cat_dog/labels.txt

When I try to remove the $ symbols it still returns the same error. When I ran echo $model and echo $data, it didn’t return anything, but I can confirm that there are files in the directory.

Hi @a_mac_user, since you haven’t set the $model and $data variables in your terminal, just specify the paths you want to use instead of using these variables.

Try this instead:

imagenet.py --model=models/cat_dog/resnet18.onnx --input_blob=input_0 --output_blob=output_0 --labels=data/cat_dog/labels.txt data/cat_dog/test/cat/01.jpg cat.jpg

I have completely wiped my jetson, and I will try the entire tutorial again. When I get to that step, I will use your line instead.

Thanks!