Inspect the Running Python ML Process
2023-06-01
1 min read
- Set a breakpoint at the forward pass of test data.
images, labels = data
breakpoint()
outputs = net(images) # forward pass of test data
- Start the neural network python file using GDB.
$ gdb python3
(gdb) run [PATH_TO_FILE]/[FILENAME].py
-
When the process reaches the breakpoint you previously set, control will be transferred to PDB. Print out the hex memory locations of a few objects in the Python process.
).png)
-
Print out the fields/attributes of the objects.
.png)
-
Return to GDB by pressing Ctrl + C. Print the PID (process identifier) of the Python process.

You will later reference the above information to corroborate the results of your memory dump analysis.