Inspect the Running Python ML Process

2023-06-01
1 min read
  1. Set a breakpoint at the forward pass of test data.
images, labels = data
breakpoint()
outputs = net(images)               # forward pass of test data
  1. Start the neural network python file using GDB.
$ gdb python3
(gdb) run [PATH_TO_FILE]/[FILENAME].py
  1. 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. image

  2. Print out the fields/attributes of the objects. image

  3. Return to GDB by pressing Ctrl + C. Print the PID (process identifier) of the Python process. image

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