python调试三方库内的代码方法

需求

想再pytorch源码里打断点调试,而断点无法跑进三方库
参考网上删除*.egg文件不起作用

实现

添加对应launch.json并设置"justMyCode": false即可生效

{
    // 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",
            "justMyCode": false,
            "args": ["-d","dataset/interm_data","-o","run/vectornet/","-a","-b","128","-c","-cd","0","--lr","0.001","-luf","10","-ldr","0.1"]
        }
    ]
}
原文地址:https://www.cnblogs.com/azureology/p/15739718.html