Appearance
Configuration & CLI Reference
SoraSR separates runtime configuration from source code using typed YAML files validated at startup. Any YAML key can be overridden from the command line using dotted --set key=value notation.
Complete Training YAML Example
yaml
experiment:
name: sorasr_s_x4_df2k
seed: 42
precision: bf16 # fp32 | fp16 | bf16
model:
arch: sorasr_s
scale: 4
in_channels: 3
embed_dim: 64
depths: [4, 4, 4, 4]
num_heads: [4, 4, 4, 4]
window_size: 8
data:
train:
hr_dir: datasets/DF2K/HR_sub512
lr_dir: datasets/DF2K/LR_sub128
patch_size: 64 # LR patch size (HR = patch_size * scale)
batch_size: 16
num_workers: 8
augment:
hflip: true
vflip: true
rot90: true
val:
hr_dir: datasets/benchmarks/Set14/GTmod12
lr_dir: datasets/benchmarks/Set14/LRbicx4
interval_steps: 5000
optim:
type: adamw
lr: 2.0e-4
betas: [0.9, 0.99]
weight_decay: 0.0
grad_clip: 1.0
scheduler:
type: cosine
warmup_steps: 2000
total_steps: 300000
min_lr: 1.0e-6
ema:
enabled: true
decay: 0.999
losses:
charbonnier:
weight: 1.0
eps: 1.0e-3
fft:
weight: 0.02CLI Subcommands
| Command | Purpose | Key Flags |
|---|---|---|
sorasr train | Launch or resume training | --config, --work-dir, --resume, --precision, --set |
sorasr infer | Upscale image(s) or directories | --model, --input, --output, --tile-size, --tile-overlap |
sorasr eval | Compute PSNR / SSIM / LPIPS | --model, --lr-dir, --hr-dir, --scale, --metrics |
sorasr export onnx | Export checkpoint to ONNX | --checkpoint, --output, --opset, --dynamic-hw, --verify |
sorasr data prepare-subimages | Slice HR images for fast I/O | --input, --output, --crop-size, --step, --workers |
sorasr doctor | Inspect CUDA / ORT / TRT setup | --json |
Common Troubleshooting
CUDA Out of Memory During Inference
- Reduce
--tile-sizefrom512to256(or128) and set--precision fp16orbf16. - Confirm tiled batch size is
1on GPUs with<= 8 GBVRAM.
Subtle Grid Lines Between Tiles
- Increase
--tile-overlapfrom8to16or24pixels so the raised-cosine blending margin covers the attention window width.
ONNX Verification Mismatch Exceeds Tolerance
- Ensure the checkpoint was loaded in
.eval()mode with EMA weights selected. - Upgrade to
--opset 17or newer soLayerNormalizationexports natively rather than decomposing into numerically drifted primitives.