Views
No views yet
main.py,通过 --config 选择配置文件,通过 --mode 选择训练、验证、采样或测试流程。pip install -r requirements.txtinstall.sh 里的列表补装。Windows 下直接执行 python main.py ... 即可,不必依赖 .sh 脚本。data.name 必须和 selector/data_selector.py 里注册的数据集名称一致。常见数据目录如下:1data/<dataset_name>/
2 train_in/*.mat
3 train_gt/*.mat
4 test_in/*.mat
5 test_gt/*.mat
6url: https://github.com/kqwang/Phase_unwrapping_by_U-Net.mat 文件里通常读取 input 和 gt 字段。1data/<dataset_name>/
2 train_wrapped/*.mat
3 train_absolute/*.mat
4 test_wrapped/*.mat
5 test_absolute/*.mat
6url: https://github.com/zhoulifan/InSAR-DLPU.mat 文件里通常读取 input 和 output 字段。--config 只填 configs/ 目录下的文件名,不要再加 configs/ 前缀。python main.py --config fdu_synpu_128_big.yaml --mode train --training_from_scratchpython main.py --config dlpu_dlpu_256_big.yaml --mode train_model --training_from_scratchpython main.py --config fdu_synpu_128_big.yaml --mode sample --sampling_from_epoch 100python main.py --config fdu_synpu_128_big.yaml --mode val --sampling_from_epoch 1001python main.py --config dlpu_dlpu_256_big.yaml --mode sample_model --sampling_from_epoch 100
2python main.py --config dlpu_dlpu_256_big.yaml --mode val_model --sampling_from_epoch 100| mode | 说明 |
|---|---|
train | 训练扩散模型 |
sample | 扩散模型推理采样 |
val | 扩散模型验证 |
test | 扩散模型测试 |
train_model | 训练普通模型 |
sample_model | 普通模型采样 |
val_model | 普通模型验证 |
test_model | 普通模型测试 |
train_multi | 扩散模型多卡训练 |
train_multi_model | 普通模型多卡训练 |
--training_from_scratch:强制从头训练,不自动续训。--sampling_from_epoch N:指定加载第 N 轮 checkpoint;不传则默认用最新 checkpoint。--hyper:启用超参搜索流程。assets/<data_name>/<diffusion_name or model_name>/ckpt/:模型权重sample/<epoch>/:采样结果val/<epoch>/:验证结果tb/:TensorBoard 日志wandb/:wandb 本地缓存training.batch_size、val.batch_size、sampling.batch_size 要和 GPU 数量匹配。assets/.../ckpt/epoch_*.pth,默认会自动续训。configs/*.yaml,不要直接改训练代码。1python main.py --config wav_synpu_128_mid.yaml --mode train --training_from_scratch
2python main.py --config wav_synpu_128_mid.yaml --mode sample --sampling_from_epoch 100
3python main.py --config wav_synpu_128_mid.yaml --mode val --sampling_from_epoch 100