Stepping into FastAI Library

Loving the course.

I currently having a simple issue where untar_data is not extracting into the folder I am expecting.
I want to know how to enable source debugging or step-through for the FastAI library so I can better understand its inner workings.

Simple code but I want to step into this and trace it through.
data_path = Path(‘data’)
os.makedirs(data_path, exist_ok=True)
path = untar_data(URLs.CAMVID_TINY, data=data_path , force_download=True)

Hello,
m glad you’re enjoying the course! Let’s get you set up for debugging the untar_data function in the FastAI library.

To enable source debugging or step-through for FastAI, you can use Python’s built-in pdb module or an IDE like Visual Studio Code (VS Code) or PyCharm, which have integrated debugging tools. Here’s a step-by-step guide using pdb:

Import the pdb module:
Python

import pdb
Set a breakpoint before the untar_data call:
Python

data_path = Path(‘data’) MyCenturaHealth Login

os.makedirs(data_path, exist_ok=True)
pdb.set_trace() # This will start the debugger
path = untar_data(URLs.CAMVID_TINY, data=data_path, force_download=True)
Best Regards
esther598

Thanks esther,
That almost sounds too easy.

I look forward to stepping into FastAI and seeing what it does at each step.

Thanks for the help.

Thanks for your help and you pointed me in the right direction.
Turns out the pdb.setup_trace() is used for running from the cmd line.

The option I needed was to disable Debug Just My Code options in VSCode.

From Jupyter, I can now step in and see all the FastAI magic in action. :slight_smile: