Running two models in parallel on jetson nano

Dear all,
I want to be able to run two image models: One classification and the other regression at the same time. I looked in the tutorials but I couldn’t find an example for that. Can you please help me/point me in the right direction?
Thank you very much,


What kind of framework do you use?
If you are using TensorRT, you can just launch them at the same time.


Would it be possible in PyTorch? Say I took a resnet18 model like the one shipped in the Jetson Nano sample codes -

        model = torchvision.models.resnet18(pretrained=True)
        model.fc = torch.nn.Linear(512, len(dataset.categories))

and in training I train for 2 outputs, one for regression -

        for images, category_idx, xy in iter(train_loader):
            # send data to device
            images =
            xy =

and another for classification -

        for images, labels in iter(train_loader):
            # send data to device
            images =
            labels =

Is this approach even possible in the PyTorch framework? I am guessing it is not, but could use some pointers.


Suppose yes.
You can treat resnet18 as a feature extractor.
And add one fully-connected layer for the regression output and another one for label output.

However, this issue should be independent to the Nano device.
Please use a desktop environment for training task.


Will do, thanks!