Files
ModelTrainEval/configs/model/resnet18.yaml
T
Shaun ZhouandClaude Opus 5 47fb0f1125 fix(configs): 修复 resnet18 训练配置无法构建,并补上对应的评估配置
- configs/train/resnet18.yaml 此前直接报错:它同时继承 tiny_conv 与 resnet18 的模型
  配置,深度合并后 backbone 混了两边字段。在 configs/model/resnet18.yaml 的 backbone
  上加 _replace_: true 整块替换
- _replace_ 标记此前不生效:_load_raw 对每个 base 都会先 deep_merge({}, data),
  标记在参与替换判断之前就被剥掉了。改为合并期间保留、load_config 末尾统一剥除
- 新增 configs/eval/resnet18.yaml:评估必须与训练用同一套模型配置,否则构建出的
  骨架与权重对不上,而此前只有 baseline 一个评估配置
- 新增参数化测试:仓库里每个配置都要能真的构建出组件(片段自动跳过),
  且训练/评估配置对的 model 段必须一致
- README 补充骨架与配置对的对应表

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-04 15:42:14 +08:00

19 lines
520 B
YAML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# torchvision resnet18:stride 32 + 3 次上采样 => 输出 stride 4。
model:
name: defect_net
backbone:
# 整块替换:不加这行的话,从 tiny_conv 继承来的 widths/depths/block 会残留,
# 传给 TorchvisionBackbone 直接报错。见 utils/config.py::deep_merge
_replace_: true
name: torchvision
arch: resnet18
pretrained: true
in_channels: 3
neck:
name: upsample
channels: 64
num_upsamples: 3
head:
hidden_channels: 64
with_classification: true