Skip to content

Commit

Permalink
remove installation
Browse files Browse the repository at this point in the history
Signed-off-by: YunLiu <[email protected]>
  • Loading branch information
KumoLiu committed Sep 9, 2024
1 parent 26c3db5 commit 74a8ed6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 16 deletions.
13 changes: 5 additions & 8 deletions generation/2d_ldm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,9 @@ python download_brats_data.py -e ./config/environment.json

Disclaimer: We are not the host of the data. Please make sure to read the requirements and usage policies of the data and give credit to the authors of the dataset!

### 2. Installation
Please refer to the [Installation of MONAI Generative Model](../README.md)
### 2. Run the example

### 3. Run the example

#### [3.1 2D Autoencoder Training](./train_autoencoder.py)
#### [2.1 2D Autoencoder Training](./train_autoencoder.py)

The network configuration files are located in [./config/config_train_32g.json](./config/config_train_32g.json) for 32G GPU and [./config/config_train_16g.json](./config/config_train_16g.json) for 16G GPU. You can modify the hyperparameters in these files to suit your requirements.

Expand Down Expand Up @@ -74,7 +71,7 @@ An example reconstruction result is shown below:
<img src="./figs/recon.png" alt="Autoencoder reconstruction result")
</p>

#### [3.2 2D Latent Diffusion Training](./train_diffusion.py)
#### [2.2 2D Latent Diffusion Training](./train_diffusion.py)
The training script uses the batch size and patch size defined in the configuration files. If you have a different GPU memory size, you should adjust the `"batch_size"` and `"patch_size"` parameters in the `"diffusion_train"` to match your GPU. Note that the `"patch_size"` needs to be divisible by 16 and no larger than 256.

To train with single 32G GPU, please run:
Expand All @@ -97,7 +94,7 @@ torchrun \
<img src="./figs/val_diffusion.png" alt="latent diffusion validation curve" width="45%" >
</p>

#### [3.3 Inference](./inference.py)
#### [2.3 Inference](./inference.py)
To generate one image during inference, please run the following command:
```bash
python inference.py -c ./config/config_train_32g.json -e ./config/environment.json --num 1
Expand All @@ -115,7 +112,7 @@ An example output is shown below.
<img src="./figs/syn_3.jpeg" width="20%" >
</p>

### 4. Questions and bugs
### 3. Questions and bugs

- For questions relating to the use of MONAI, please use our [Discussions tab](https://github.com/Project-MONAI/MONAI/discussions) on the main repository of MONAI.
- For bugs relating to MONAI functionality, please create an issue on the [main repository](https://github.com/Project-MONAI/MONAI/issues).
Expand Down
13 changes: 5 additions & 8 deletions generation/3d_ldm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,9 @@ python download_brats_data.py -e ./config/environment.json

Disclaimer: We are not the host of the data. Please make sure to read the requirements and usage policies of the data and give credit to the authors of the dataset!

### 2. Installation
Please refer to the [Installation of MONAI Generative Model](../README.md)
### 2. Run the example

### 3. Run the example

#### [3.1 3D Autoencoder Training](./train_autoencoder.py)
#### [2.1 3D Autoencoder Training](./train_autoencoder.py)

The network configuration files are located in [./config/config_train_32g.json](./config/config_train_32g.json) for 32G GPU
and [./config/config_train_16g.json](./config/config_train_16g.json) for 16G GPU.
Expand Down Expand Up @@ -73,7 +70,7 @@ torchrun \

With eight DGX1V 32G GPUs, it took around 55 hours to train 1000 epochs.

#### [3.2 3D Latent Diffusion Training](./train_diffusion.py)
#### [2.2 3D Latent Diffusion Training](./train_diffusion.py)
The training script uses the batch size and patch size defined in the configuration files. If you have a different GPU memory size, you should adjust the `"batch_size"` and `"patch_size"` parameters in the `"diffusion_train"` to match your GPU. Note that the `"patch_size"` needs to be divisible by 16.

To train with single 32G GPU, please run:
Expand All @@ -96,7 +93,7 @@ torchrun \
<img src="./figs/val_diffusion.png" alt="latent diffusion validation curve" width="45%" >
</p>

#### [3.3 Inference](./inference.py)
#### [2.3 Inference](./inference.py)
To generate one image during inference, please run the following command:
```bash
python inference.py -c ./config/config_train_32g.json -e ./config/environment.json --num 1
Expand All @@ -112,7 +109,7 @@ An example output is shown below.
<img src="./figs/syn_cor.png" width="30%" >
</p>

### 4. Questions and bugs
### 3. Questions and bugs

- For questions relating to the use of MONAI, please use our [Discussions tab](https://github.com/Project-MONAI/MONAI/discussions) on the main repository of MONAI.
- For bugs relating to MONAI functionality, please create an issue on the [main repository](https://github.com/Project-MONAI/MONAI/issues).
Expand Down

0 comments on commit 74a8ed6

Please sign in to comment.