Upload folder using huggingface_hub
Browse files- README.md +15 -11
- ldm_backend_a101_train_hwd.yaml +3 -3
- ldm_backend_lightning.yaml +1 -1
- ldm_backend_vqgan_marmousi.yaml +1 -1
README.md
CHANGED
|
@@ -10,10 +10,9 @@ For the Diffusers-format release with bundled inference code, see
|
|
| 10 |
| --- | --- |
|
| 11 |
| `stage1_vqgan.ckpt` | Stage 1 VQGAN checkpoint (first stage autoencoder), 721 MB. |
|
| 12 |
| `stage2_ldm.ckpt` | Stage 2 latent diffusion / CLDM checkpoint (original A101 run, epoch 212 / step 13,991), 4.3 GB. |
|
| 13 |
-
| `
|
| 14 |
-
| `
|
| 15 |
-
| `
|
| 16 |
-
| `ldm_backend_lightning.yaml` | Lightning trainer, logger, and Overthrust eval callback config. |
|
| 17 |
|
| 18 |
## Download the checkpoints
|
| 19 |
|
|
@@ -45,10 +44,10 @@ Clone the training code repository and copy the checkpoints/configs into it:
|
|
| 45 |
```bash
|
| 46 |
git clone <SAII-CLDM-training-repo>
|
| 47 |
cd SAII-CLDM
|
| 48 |
-
mkdir -p models
|
| 49 |
cp saii-cldm-ldm-checkpoints/stage1_vqgan.ckpt models/
|
| 50 |
cp saii-cldm-ldm-checkpoints/stage2_ldm.ckpt models/
|
| 51 |
-
cp saii-cldm-ldm-checkpoints/
|
| 52 |
```
|
| 53 |
|
| 54 |
Set the required paths in `.env` (copy from `.env.example`):
|
|
@@ -58,12 +57,11 @@ FIRST_STAGE_CKPT=./models/stage1_vqgan.ckpt
|
|
| 58 |
OVERTHRUST_DATA_DIR=./data/overthrust
|
| 59 |
```
|
| 60 |
|
| 61 |
-
Then run CLDM inference on the Overthrust benchmark:
|
| 62 |
|
| 63 |
```bash
|
| 64 |
CUDA_VISIBLE_DEVICES=0 python eval_overthrust.py CLDM \
|
| 65 |
--ckpt ./models/stage2_ldm.ckpt \
|
| 66 |
-
--config ./configs/stage2_ldm_config.yaml \
|
| 67 |
--output runs/eval_cldm \
|
| 68 |
--device cuda --steps 30
|
| 69 |
```
|
|
@@ -73,7 +71,6 @@ If GPU 0 is occupied or you hit OOM, switch to another GPU:
|
|
| 73 |
```bash
|
| 74 |
CUDA_VISIBLE_DEVICES=1 python eval_overthrust.py CLDM \
|
| 75 |
--ckpt ./models/stage2_ldm.ckpt \
|
| 76 |
-
--config ./configs/stage2_ldm_config.yaml \
|
| 77 |
--output runs/eval_cldm \
|
| 78 |
--device cuda --steps 30
|
| 79 |
```
|
|
@@ -82,12 +79,19 @@ The script will save `metrics_summary.json`, numpy arrays, and a comparison figu
|
|
| 82 |
|
| 83 |
## Resume training
|
| 84 |
|
| 85 |
-
|
| 86 |
|
| 87 |
```bash
|
| 88 |
CUDA_VISIBLE_DEVICES=0 python train_ldm_backend.py -t \
|
| 89 |
--resume ./models/stage2_ldm.ckpt \
|
| 90 |
-
--base ./configs/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 91 |
```
|
| 92 |
|
| 93 |
## Paper
|
|
|
|
| 10 |
| --- | --- |
|
| 11 |
| `stage1_vqgan.ckpt` | Stage 1 VQGAN checkpoint (first stage autoencoder), 721 MB. |
|
| 12 |
| `stage2_ldm.ckpt` | Stage 2 latent diffusion / CLDM checkpoint (original A101 run, epoch 212 / step 13,991), 4.3 GB. |
|
| 13 |
+
| `ldm_backend_vqgan_marmousi.yaml` | Stage 1 VQGAN training config. |
|
| 14 |
+
| `ldm_backend_a101_train_hwd.yaml` | Stage 2 CLDM training config, aligned with the released `stage2_ldm.ckpt`. |
|
| 15 |
+
| `ldm_backend_lightning.yaml` | Lightning trainer / logger / Overthrust eval callback config (used for Stage 2). |
|
|
|
|
| 16 |
|
| 17 |
## Download the checkpoints
|
| 18 |
|
|
|
|
| 44 |
```bash
|
| 45 |
git clone <SAII-CLDM-training-repo>
|
| 46 |
cd SAII-CLDM
|
| 47 |
+
mkdir -p models configs
|
| 48 |
cp saii-cldm-ldm-checkpoints/stage1_vqgan.ckpt models/
|
| 49 |
cp saii-cldm-ldm-checkpoints/stage2_ldm.ckpt models/
|
| 50 |
+
cp saii-cldm-ldm-checkpoints/*.yaml configs/
|
| 51 |
```
|
| 52 |
|
| 53 |
Set the required paths in `.env` (copy from `.env.example`):
|
|
|
|
| 57 |
OVERTHRUST_DATA_DIR=./data/overthrust
|
| 58 |
```
|
| 59 |
|
| 60 |
+
Then run CLDM inference on the Overthrust benchmark. `eval_overthrust.py` defaults to `configs/ldm_backend_a101_train_hwd.yaml`, which is now aligned with the released Stage 2 checkpoint:
|
| 61 |
|
| 62 |
```bash
|
| 63 |
CUDA_VISIBLE_DEVICES=0 python eval_overthrust.py CLDM \
|
| 64 |
--ckpt ./models/stage2_ldm.ckpt \
|
|
|
|
| 65 |
--output runs/eval_cldm \
|
| 66 |
--device cuda --steps 30
|
| 67 |
```
|
|
|
|
| 71 |
```bash
|
| 72 |
CUDA_VISIBLE_DEVICES=1 python eval_overthrust.py CLDM \
|
| 73 |
--ckpt ./models/stage2_ldm.ckpt \
|
|
|
|
| 74 |
--output runs/eval_cldm \
|
| 75 |
--device cuda --steps 30
|
| 76 |
```
|
|
|
|
| 79 |
|
| 80 |
## Resume training
|
| 81 |
|
| 82 |
+
Stage 2 training / resume from the released checkpoint:
|
| 83 |
|
| 84 |
```bash
|
| 85 |
CUDA_VISIBLE_DEVICES=0 python train_ldm_backend.py -t \
|
| 86 |
--resume ./models/stage2_ldm.ckpt \
|
| 87 |
+
--base ./configs/ldm_backend_a101_train_hwd.yaml ./configs/ldm_backend_lightning.yaml
|
| 88 |
+
```
|
| 89 |
+
|
| 90 |
+
Stage 1 VQGAN training from scratch:
|
| 91 |
+
|
| 92 |
+
```bash
|
| 93 |
+
CUDA_VISIBLE_DEVICES=0 python train_ldm_backend.py -t \
|
| 94 |
+
--base ./configs/ldm_backend_vqgan_marmousi.yaml
|
| 95 |
```
|
| 96 |
|
| 97 |
## Paper
|
ldm_backend_a101_train_hwd.yaml
CHANGED
|
@@ -14,7 +14,7 @@ model:
|
|
| 14 |
cond_stage_key:
|
| 15 |
- dipin
|
| 16 |
- record
|
| 17 |
-
cond_stage_trainable:
|
| 18 |
conditioning_key: concat
|
| 19 |
concat_mode: true
|
| 20 |
image_size: 64
|
|
@@ -43,7 +43,7 @@ model:
|
|
| 43 |
first_stage_config:
|
| 44 |
target: ldm.models.autoencoder.VQModelInterface
|
| 45 |
params:
|
| 46 |
-
ckpt_path: ${oc.env:FIRST_STAGE_CKPT,./models/
|
| 47 |
embed_dim: 1
|
| 48 |
n_embed: 32768
|
| 49 |
ddconfig:
|
|
@@ -74,7 +74,7 @@ data:
|
|
| 74 |
target: main.DataModuleFromConfig
|
| 75 |
params:
|
| 76 |
batch_size: 24
|
| 77 |
-
num_workers:
|
| 78 |
wrap: false
|
| 79 |
train:
|
| 80 |
target: ldm.data.seisimic.Marmousi3_256
|
|
|
|
| 14 |
cond_stage_key:
|
| 15 |
- dipin
|
| 16 |
- record
|
| 17 |
+
cond_stage_trainable: false
|
| 18 |
conditioning_key: concat
|
| 19 |
concat_mode: true
|
| 20 |
image_size: 64
|
|
|
|
| 43 |
first_stage_config:
|
| 44 |
target: ldm.models.autoencoder.VQModelInterface
|
| 45 |
params:
|
| 46 |
+
ckpt_path: ${oc.env:FIRST_STAGE_CKPT,./models/stage1_vqgan.ckpt}
|
| 47 |
embed_dim: 1
|
| 48 |
n_embed: 32768
|
| 49 |
ddconfig:
|
|
|
|
| 74 |
target: main.DataModuleFromConfig
|
| 75 |
params:
|
| 76 |
batch_size: 24
|
| 77 |
+
num_workers: 1
|
| 78 |
wrap: false
|
| 79 |
train:
|
| 80 |
target: ldm.data.seisimic.Marmousi3_256
|
ldm_backend_lightning.yaml
CHANGED
|
@@ -15,7 +15,7 @@ lightning:
|
|
| 15 |
params:
|
| 16 |
entity: 601882280-xi-an-jiaotong-university-
|
| 17 |
name: ldm-backend-a101-train-hwd
|
| 18 |
-
offline:
|
| 19 |
project: saii-cldm-reproduce
|
| 20 |
target: pytorch_lightning.loggers.WandbLogger
|
| 21 |
trainer:
|
|
|
|
| 15 |
params:
|
| 16 |
entity: 601882280-xi-an-jiaotong-university-
|
| 17 |
name: ldm-backend-a101-train-hwd
|
| 18 |
+
offline: true
|
| 19 |
project: saii-cldm-reproduce
|
| 20 |
target: pytorch_lightning.loggers.WandbLogger
|
| 21 |
trainer:
|
ldm_backend_vqgan_marmousi.yaml
CHANGED
|
@@ -76,7 +76,7 @@ lightning:
|
|
| 76 |
entity: 601882280-xi-an-jiaotong-university-
|
| 77 |
project: saii-cldm-reproduce
|
| 78 |
name: ldm-backend-vqgan-marmousi
|
| 79 |
-
offline:
|
| 80 |
trainer:
|
| 81 |
benchmark: true
|
| 82 |
gpus: 1
|
|
|
|
| 76 |
entity: 601882280-xi-an-jiaotong-university-
|
| 77 |
project: saii-cldm-reproduce
|
| 78 |
name: ldm-backend-vqgan-marmousi
|
| 79 |
+
offline: true
|
| 80 |
trainer:
|
| 81 |
benchmark: true
|
| 82 |
gpus: 1
|