vscode python debug方式
2026/7/23 3:43:06 网站建设 项目流程

找到vscode左侧的debug案件,新建

点击创建launch.json文件

然后可以看到在当前项目下创建一个了launch.json的文件

现在需要根据要跑的代码修改aunch.json文件内容:

使用下面代码查看python位置:

which python

lauch.json的模板文件:

{ "version": "0.2.0", "configurations": [ { "name": "Debug Name", "type": "python", "request": "launch", "program": "${workspaceFolder}/train.py", "console": "integratedTerminal", "justMyCode": false, "env": { "CUDA_VISIBLE_DEVICES": "0", }, "args": [ "--traj_cons", "--rgb_pad", "10", "--gripper_pad", "4", "--gradient_accumulation_steps", "4", ], "python": "/home/xxx/miniconda3/envs/dreamvla/bin/python", "cwd": "${workspaceFolder}", "debugOptions": [ "RedirectOutput" ] } ] }

根据模版文件,把要debug的命令行代码文件给GPT,让GPT改写成lauch.json的格式即可debug

需要专业的网站建设服务?

联系我们获取免费的网站建设咨询和方案报价,让我们帮助您实现业务目标

立即咨询