UPDATE I learned about more options since posting the thread and recorded a followup video https://www.youtube.com/watch?v=xovzuPfuglE. Timestamps to the all 8 ways are at the bottom of this post.
Hello folks!
After watching the Lesson 1, I’ve decided to spend some time on figuring out ways to debug and explore fastai. Since I know from experience I’ll be doing it a lot during the course.
I figured it might be useful for others, especially beginners, so I made a video tutorial out of it: https://www.youtube.com/watch?v=T1RJvUZieig
There is nothing groundbreaking here, things you can know from previous courses, forums or tutorials. But I hope there will be people who find it useful.
I’m using the Lesson 1 notebook as the starting point and the five ways are: logging, pdb, pixiedust, VS code, and notebook juggling. You can jump directly to these timestamps:
Thanks @slawekbiel! I have a question. It is slightly unrelated to debugging, but I got curious haha I noticed that the show_batch function is defined multiple times. How is that possible? Wouldn’t one conflict with the other? For example, you showed there was a show_batch function calling another show_batch function (which you copied from another notebook). My intuition would be that a recursive call would occur there, but actually both of them continued existing even though they had the same name. That’s counter intuitive to me that’s why I decided to ask. Not sure how I would google that hahah Thanks!
TypeDispatch — allows for the same function to work differently for different types
So, that means that by using the @typedispatch decorator, I can declare the very same function multiple times, but have it to act differently depending on it’s input type. Is that correct?
I see that it is forty minutes long, and I find that a bit discouraging. In other words, I wasn’t sure if I should invest the time to fast forward through it.
Do you think you could highlight the “five ways to debug in fastai”, for example in the video description, or even in a separate notebook?
That’s a very valid point. I actually didn’t expect this to be this long (I have no experience in content creation). If you have limited time, you’d get a much better return on time invested by listening to someone who’s more knowledgable and a better speaker, like Jeremy Howard
Anyway the five things I talk about is:
putting print statements into the fastai code
using pdb in jupyter
using pixiedust in jupyter
running development notebooks from fastai
debugging a local script with vscode
I actually learned about two more ways since. I’m yet to explore:
connecting vscode to a running notebook instance
installing a newly created debugger inside jupyter lab.
You can learn about any of this by googling, searching the forums and experimenting on your own.
Cool, could you tell me how you’re running vscode on headless WSL1? An X-Server or something? Or provide any links you used to setup?
PS - I know I can also just google this info (and I have before) but I see many conflicting reports on WSL. I want mine to work just like the way you have it running.
Thanks! Here is my question, does anyone have an idea on how to do memory profiling for the GPU? In a way that is easy enough for a beginner to understand?
How did you install the fastai2 library?
On your video, I noticed that the path of the fastai2 source code seemed to
be on the same directory as your notebook, is this correct?
My mistake is maybe that I just did a pip install fastai2…
Also I saw in the video you the problem you had with training the model so this
might not be the best debugging solution right now.
Thanks for posting the videos, BTW!
Best regards,
Butch