vscode python debug方式
根据模版文件,把要debug的命令行代码文件给GPT,让GPT改写成lauch.json的格式即可debug。然后可以看到在当前项目下创建一个了launch.json的文件。找到vscode左侧的debug案件,新建。点击创建launch.json文件。
·
找到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
魔乐社区(Modelers.cn) 是一个中立、公益的人工智能社区,提供人工智能工具、模型、数据的托管、展示与应用协同服务,为人工智能开发及爱好者搭建开放的学习交流平台。社区通过理事会方式运作,由全产业链共同建设、共同运营、共同享有,推动国产AI生态繁荣发展。
更多推荐

所有评论(0)