How to Debug PyTorch Source Code - Deep Learning in Python

preview_player
Показать описание
In this episode, we learn how to set up debugging for PyTorch source code in Visual Studio Code.

🕒🦎 VIDEO SECTIONS 🦎🕒

00:27 Visual Studio Code
00:55 Python Debugging Extension
01:30 Debugging a Python Program
03:46 Manual Navigation and Control of a Program
06:34 Configuring VS Code to Debug PyTorch
08:44 Stepping into PyTorch Source Code
10:36 Choosing the Python Environment
12:30 Collective Intelligence and the DEEPLIZARD HIVEMIND

💥🦎 DEEPLIZARD COMMUNITY RESOURCES 🦎💥

👋 Hey, we're Chris and Mandy, the creators of deeplizard!

👉 Check out the website for more learning material:

💻 ENROLL TO GET DOWNLOAD ACCESS TO CODE FILES

🧠 Support collective intelligence, join the deeplizard hivemind:

🧠 Use code DEEPLIZARD at checkout to receive 15% off your first Neurohacker order
👉 Use your receipt from Neurohacker to get a discount on deeplizard courses

👀 CHECK OUT OUR VLOG:

❤️🦎 Special thanks to the following polymaths of the deeplizard hivemind:
Tammy
Mano Prime
Ling Li

🚀 Boost collective intelligence by sharing this video on social media!

👀 Follow deeplizard:

🎓 Deep Learning with deeplizard:

🎓 Other Courses:

🛒 Check out products deeplizard recommends on Amazon:

🎵 deeplizard uses music by Kevin MacLeod

❤️ Please use the knowledge gained from deeplizard content for good, not evil.
Рекомендации по теме
Комментарии
Автор

👉 Check out the blog post and other resources for this video:

👀 Come say hey to us on OUR VLOG:

deeplizard
Автор

Sean Evans is so talented! Hosting Hot Ones and teaching python too. Wow!

StellarLlama
Автор

Love this narrowly defined subject matter. Keep it simple at its best. Thanks.

Sikuq
Автор

What I learned:
1.
How to use vscode debugging the pytorch code
2.
You need vscode
3.
You need python extention
4.
You need configure the python debugging configure justmycode:False
5.
breakpoit : just run untill here
6.
you can hangover to see variables
7.
you can add watch to see variabes
8.
continue: run to other breakpoint
9.
stepover:see what will do this code
10.
step in: dive into call stacks
11.
step out:get out this level to the call level



Thank you very
For a long time, I used to learned, you should debugging the code to understand more. Becourse I am not native speaker. When I heard this . This is mean something wrong in the code. So I must I kown what is debugging..For a longtime, I just read do what the machine should do for me.
Who didn't watch this is loss for them.Hope to learn more about these tricks.
BTW now half body style is better than the big brother face style.

tingnews
Автор

Thank you for the nice tutorial.
How can one debug when the programm uses Argparse?

RH-jcww
Автор

thanks a lot for the walkthrough!
A quick question: don't jupyter notebooks help in order to visualize variables, data etc? Wouldn't that approach be easier (specifically for ML and DL) instead of debugging?

harryayce
Автор

thanks a lot for all videos, please i coming her from 19 video can you explain how you find input size of nn.linear 4*4 please ??

arabnaouel
Автор

There is a problem with stepping into the library's code when you're using virtual env via pipenv. Once you switch Python interpreter out of the virtual env the option works well otherwise it just ignores "justMyCode" flag :(

marcin.sobocinski
Автор

Hello great series. I am having an issue when I start debugging my code the debugger stops at the command "import torchvision" and I get the error "Exception has occurred: ImportError
DLL load failed: The specified module could not be found." (this does not happen when i run my code on jupyter notebook)

affanzafar
Автор

very nice explanation but VScode is not so proper IDE, PyCharm is much more better

rezvanbahmani
Автор

The name is inaccurate, this is not debugging of PyTorch source code it's debugging of PyTorch models. PyTorch is mostly written in C++..

andreipokrovsky
Автор

`"request": "test"` is deprecated, please keep as `"request": "launch"` and add `"purpose": ["debug-test"]` instead.

weizhili
Автор

Very valuable content guys!! Post more related to GEN AI

shanthalaxmikumar
Автор

{
"question": "What python keyword/function can be used to also cause code to pause and be debugged?",
"choices": [
"breakpoint()",
"pause()",
"debug()",
"debugger()"
],
"answer": "breakpoint()",
"creator": "Ling Li",
"creationDate": "2022-07-17T08:23:31.230Z"
}

lingfromhongkong
Автор

Great, quality content. Extremely informative - thanks!

jameshudnall
Автор

Great Job !. But I think, ur example is debug a code or source in general and not explicit just for PyTorch.

nawwaradam
Автор

Thank's 1000 times. Greate tutorial, very helpful.

Nissearne
Автор

Thank you so much for this video. It becomes so difficult to resolve such issues, otherwise. Thanks again.

jitendradhiman
Автор

Hi, thanks for this. From the video, it looks like you're using Pytorch on windows? Any problems with that or is it pretty smooth?

matthewchung
Автор

Thank you so much for all the videos, I'm really enjoying your stuff so far!

I'm experiencing an error I can't wrap my head around though here.

- I've created a program that is identical to the one you show at the start of the video.
- Now if I debug this file on itself it just runs without a problem.
- Once I open the folder the file resides in, I get the ModuleNotFoundError for 'torch', and so also for torchvision and torchvision.transforms.
- I've tried tuning configurations in launch.json accordingly, but this wouldn't help either. Shouldn't expect this to be the problem as well, since the file itself runs perfectly fine if I just don't try to open the folder it's in.
- I have no clue how something like this is even possible, and don't know where to look for the problem now.
- Could you help me out?

Felix