2_深度学习
VIT源码
1. vscode环境配置
- 手动创建: ①点击
RUN AND DEBUG图标 ② Select a debug configuration ③Python Debugger ④Python File - 等价运行:
python train.py --name cifar10-100_500 --dataset cifar10 --model_type ViT-B_16 --pretrained_dir checkpoint/ViT-B_16.npz
![]() |
![]() |
![]() |
|---|
{
"version": "0.2.0", // launch.json 格式版本,固定写这个
"configurations": [ // 启动配置列表,下拉框每一项对应这里一个对象
{
"name": "train", // 下拉框显示名,对应 PyCharm 的 Name
"type": "debugpy", // 使用 Python 调试器
"request": "launch", // 由 VS Code 启动脚本(不是去附加已有进程)
"program": "${workspaceFolder}/train.py", // 要跑的脚本:工作区根目录下的 train.py
"cwd": "${workspaceFolder}", // 工作目录,相对路径从这里算
"console": "integratedTerminal", // 输出打到 VS Code 内置终端
"args": [ // 传给 train.py 的命令行参数,对应 PyCharm 的 Parameters
"--name", "cifar10-100_500", // 这次实验名称
"--dataset", "cifar10", // 使用 CIFAR-10 数据集
"--model_type", "ViT-B_16", // 模型结构:ViT-B/16
"--pretrained_dir", "checkpoint/ViT-B_16.npz" // 预训练权重路径
]
}
]
}
- Title: 2_深度学习
- Author: 明廷盛
- Created at : 2026-10-20 12:59:13
- Updated at : 2026-10-20 20:58:00
- Link: https://blog.20040424.xyz/2026/10/20/🤖人工智能/2_深度学习/
- License: All Rights Reserved © 明廷盛

