the-full-stack / fsdl-text-recognizer-2021-labs

Complete deep learning project developed in Full Stack Deep Learning, Spring 2021
https://bit.ly/berkeleyfsdl
MIT License
452 stars 281 forks source link

How to debug lab code in VSCode ? #41

Closed elkhand closed 2 years ago

elkhand commented 2 years ago

Let's assume you want to debug fsdl-text-recognizer-2021-labs/lab1/training/run_experiment.py for lab1 in VSCode - in other words, debug the current Python file. You need to create launch.json file for making code debuggable in VSCode. Then you need to append a single line to your launch.json file :

{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Python: Current File",
            "type": "python",
            "request": "launch",
            "program": "${file}",
            "console": "integratedTerminal",
             "env": { "PYTHONPATH": "${workspaceRoot}/lab1"}
        }
    ]
}