Pytorch model optimization in jetson nano

Hey techies,
I am trying to load a resnet34 model which was trained and saved on my laptop (with pytorch) . I copied the the .pkl (pickle) file and .pth (pytorch model) files from my laptop to jetson nano. Now I ran my code which would implement these models . But the code ran very slow . I think the model loading would have taken so much time. It took more than a minute to detect and give me the output. My question is can i use tensorrt to optimize my model? if so how as I already have my .pth file ready , so i think i dont have to retrain my model in jetson nano as that would be tedious , please help!!!

NOTE: what exactly I did was in my laptop collected various environmental sound dataset and converted them into spectogram and trained those spectograms in my laptop using pytorch after which i got my .pkl and .pth files.

Hi,

Please check our pyTorch2trt example here:

Thanks.

Hi @AastaLLL , in that link , its like I have to train the model again from the beginning. I already have the trained model .pth file. I just have to optimize that .pth file , is that possible?

Hi,

YES. You can skip the training part and convert your model with the converter here:

Thanks.

Thank you and do you have python tensorrt support for windows 10?

YES.

Please check this document:
https://docs.nvidia.com/deeplearning/tensorrt/install-guide/index.html#installing-zip

Thanks.

Thank you so much