0

Here is the situation (as an example) - I ran a ML learning python script (which I wrote) for a long time but I didn't add functionality to save its weights.

My question in this situation is if it's possible to somehow intercept the running python interpreter and execute a command within the program context.

For example since I have model_seq global variable inside the running program - I would like to execute:

model_seq.save_weights("./model_weights")

Inside the process.

I've heard this is somewhat possible with gdb.

(Personally I know this can be done for sure with a C program and gdb - but since Python is compiled and interpreted the steps are a bit unclear for me (and I'm not sure if I would actually need a special python3 build or the default ubuntu one I have running will work))

AnArrayOfFunctions
  • 3,452
  • 2
  • 29
  • 66

0 Answers0