{
  // 使用 IntelliSense 了解相关属性。 
  // 悬停以查看现有属性的描述。
  // 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387
  "version": "0.2.0",
  "configurations": [
    {
      "name": "python debug",
      "type": "python",
      "request": "launch",
      "program": "${file}",
      "args":[
        "--weights","./yolov7.pt",
        "--version", "7",
        "--img-size", "640",
        "--batch-size", "1",
        "--device", "cpu",
        "--simplify",
        "--opset", "12"
      ],
      "console": "integratedTerminal",
      "python": "/root/anaconda3/envs/yolo_trt8_py39/bin/python",
      "justMyCode": true,
      "cwd": "${fileDirname}"
    }
  ]
}

效果等同于传参:

# 导出普通的 ONNX
python ./export.py \
    --weights ./yolov7.pt \
    --version 7 \
    --img-size 640 \
    --batch-size 1 \
    --device cpu \
    --simplify \
    --opset 12