VS Code Remote Debugging
Prerequisites
Add debugpy to Your Code
Python Code
import debugpy
import numpy as np
import time
# Listen on port 5678 inside the container
debugpy.listen(5678)
# Halt execution until VS Code attaches
debugpy.wait_for_client()
# Your training code runs after debugger connects
for x in range(1, 20):
print(f"Doing computation {x}")
data = np.random.random((50, 50))
sum = np.sum(data)
time.sleep(2)valohai.yaml
Start Execution with SSH
Configure VS Code
1. Create Debug Configuration
2. Open SSH Tunnel
3. Attach Debugger

Debug Your Code

Common Issues
Next Steps
Last updated
Was this helpful?
