FASTER Inference with Torch TensorRT Deep Learning for Beginners - CPU vs CUDA
Hi everyone! đ In the last video we've seen how to accelerate the speed of our programs with Pytorch and CUDA - today we will take it another step further with Torch-TensorRT! We will focus on a Machine Learning process called Inference (which is when the model is trained, perfected and ready to make a prediction). For this we will load a state-of-the-art artificial neural network and we will use it to classify a picture of my cat! đđđ Specifically - we will borrow ResNet50 for our little Pytorch experiment! đ We will also run a speed test comparing Pytorch models running on CPU, on CUDA and on Torch-TensorRT - which of these do you think is faster?? â˛ď¸ TIMESTAMPS â˛ď¸ ----------------------------------- 00:00 - intro 01:05 - clone Torch-TensorRT 01:40 - install and setup Docker 03:52 - install Nvidia Container Toolkit & Nvidia Docker 2 05:02 - Torch-TensorRT container (option #1) 07:22 - Torch-TensorRT Nvidia NGC container (option #2) 09:00 - import Pytorch 09:16 - load ResNet50 10:25 - load sample image 11:45 - sample image transforms 14:48 - batch size 16:19 - prediction with ResNet50 17:12 - softmax function 18:07 - ImageNet class number to name mapping 20:10 - predict top 5 classes of sample image (topk) 23:33 - speed test benchmark function 27:33 - CPU benchmarks 28:13 - CUDA benchmarks 30:09 - trace model 31:20 - convert traced model into a Torch-TensorRT model 33:02 - TensorRT benchmarks 34:32 - download Jupyter Notebook 34:50 - HOW DID I MISS THIS??? 35:31 - thanks for watching! đ REFERENCED TUTORIALS đ ---------------------------------------------------------------------- â CUDA Parallel Computing for beginners:    â˘Â CUDA Simply Explained - GPU vs CPU Paralle...  â Neural Networks for beginners:    â˘Â Neural Network Simply Explained - Deep Lea...  â Machine Learning Databases:    â˘Â ML Datasets and How to Access them with Py...  â Gradient Descent:    â˘Â Gradient Descent - Simply Explained! ML fo...  â INSTALLATION LINKS AND BASH COMMANDS â -------------------------------------------------------------------------------------- 1. Clone Torch-TensorRT and change directory: $ git clone https://github.com/NVIDIA/Torch-TensorRT $ cd Torch-TensorRT 2. Docker installation guide: https://docs.nvidia.com/datacenter/cl... $ curl https://get.docker.com | sh \ && sudo systemctl --now enable docker $ sudo groupadd docker $ sudo usermod -aG docker $USER $ newgrp docker $ docker run hello-world 3. Nvidia Docker 2 installation: $ distribution=$(. /etc/os-release;echo $ID$VERSION_ID) \ && curl -s -L https://nvidia.github.io/nvidia-docke... | sudo apt-key add - \ && curl -s -L https://nvidia.github.io/nvidia-docke... er.list | sudo tee /etc/apt/sources.list.d/nvidia-docker.list $ sudo apt-get update $ sudo apt-get install -y nvidia-docker2 $ sudo systemctl restart docker $ sudo docker run --rm --gpus all nvidia/cuda:11.0-base nvidia-smi 4. Official Torch TensorRT Container: $ docker build -t torch_tensorrt -f ./docker/Dockerfile . $ docker run --gpus=all --rm -it -v $PWD:/Torch-TensorRT --net=host --ipc=host --ulimit memlock=-1 --ulimit stack=67108864 torch_tensorrt:latest bash $ cd /Torch-TensorRT/notebooks $ jupyter notebook --allow-root --ip 0.0.0.0 --port 8888 5. Nvidia NGC Container (alternative to 4): https://catalog.ngc.nvidia.com/orgs/n... $ docker pull nvcr.io/nvidia/pytorch:21.12-py3 $ docker run --net=host --gpus all -it --rm -v local_dir:/container_dir nvcr.io/nvidia/pytorch:21.12-py3 $ jupyter notebook --allow-root --ip 0.0.0.0 --port 8888 6. My cats picture: https://github.com/MariyaSha/Inferenc... 7. Transforms Normalize - Pytorch Documentation: https://pytorch.org/vision/stable/tra... 8. ImageNet class to name mapping: https://github.com/pytorch/hub/blob/m... 9. Complete Notebook on Github: https://github.com/MariyaSha/Inferenc... --------------------------------------------------------------------------- đ THANK YOU SO MUCH FOR WATCHING! đ Sound effect by: https://www.zapsplat.com Icons by: https://www.flaticon.com/ Resnet50 image by: https://commons.wikimedia.org/wiki/Fi...

Reviewing Your Projects!

CUDA Simply Explained - GPU vs CPU Parallel Computing for Beginners

Z. Wang - Surface models of graded gentle algebras 3

PyTorch in 1 Hour

Optimizing Real-Time ML Inference with Nvidia Triton Inference Server | DataHour by Sharmili
![Yann LeCun's $1B Bet Against LLMs [Part 1]](https://i.ytimg.com/vi/kYkIdXwW2AE/hq720.jpg?sqp=-oaymwEbCNAFEJQDSFryq4qpAw0IARUAAIhCGAG4AvcY&rs=AOn4CLBvMdKvkZHL9Earmgc5OX3Iuc1UUQ&usqp=CCc)
Yann LeCun's $1B Bet Against LLMs [Part 1]

Turn Any LLM Into an Expert đ RAG Coding Crash Course

Billionaire's WARNING: I'm SELLING. The Crash Is Already Here!

Tutorial: CUDA programming in Python with numba and cupy

Object Detection Models in Python

The Many Kinds of AI Explained - Agentic AI vs. Agents vs. LLMs and MORE!

Inference Optimization with NVIDIA TensorRT
![Youâll stop using ChatGPT after listening to this | Jonathan Pageau [ARC 2026]](https://i.ytimg.com/vi/yZUuKzDQSsI/hq720.jpg?sqp=-oaymwEbCNAFEJQDSFryq4qpAw0IARUAAIhCGAG4AvcY&rs=AOn4CLC8KSUfj-DqXfr2588L3NL3FVHRMg&usqp=CCc)
Youâll stop using ChatGPT after listening to this | Jonathan Pageau [ARC 2026]

Keynote: After the AI Hype â Whatâs Real, and Whatâs Next - Richard Campbell - 2026

Creator of C++: Bell Labs, Negative Overhead Abstraction, Mistakes | Bjarne Stroustrup

Jfrog | Jfrog Artifactory | Jfrog Artifactory Tutorial | Artifactory Tutorial | Intellipaat

2 Bouncy Things. Zero bounce.
![Build Your First Pytorch Model In Minutes! [Tutorial + Code]](https://i.ytimg.com/vi/tHL5STNJKag/hq720.jpg?sqp=-oaymwEbCNAFEJQDSFryq4qpAw0IARUAAIhCGAG4AvcY&rs=AOn4CLCapxOxIGU43OfD8zZtRiW9GjUkJg&usqp=CCc)
Build Your First Pytorch Model In Minutes! [Tutorial + Code]

1: Introduction to Neural Networks and Deep Learning; Training Deep NNs

