找到vscode左侧的debug案件,新建
点击创建launch.json文件
然后可以看到在当前项目下创建一个了launch.json的文件
现在需要根据要跑的代码修改aunch.json文件内容:
使用下面代码查看python位置:
which pythonlauch.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