Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Pbihao authored Sep 25, 2024
1 parent d463473 commit ab4b3ac
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions ControlNeXt-SVD-v2-Training/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

# Important

I found that sometimes, when I change the version of dependencies, the training may not converge at all. I haven't identified the reason yet, but I've listed all our dependencies in the [requirements.txt](./requirements.txt) file. It's a bit detailed, but you can focus on the key dependencies like `torch`, `deepspeed`, `diffusers`, `accelerate`... When issues arise, checking these first may help.
I found that sometimes, when I change the version of dependencies, the training may not converge at all. I haven't identified the reason yet, but I've listed all our dependencies in the [requirements.txt](./requirements.txt) file. It's a bit detailed, but you can focus on the key dependencies like `torch`, `deepspeed`, `diffusers`, `accelerate`... When issues arise, checking these first may help. (We use: `diffusers==0.25.0`)

> The training scripts are still under testing after my reconstruction. Since there has been significant demand, I'm releasing them now. Please keep an eye out for updates.
If you find the differences for the training and inference scripts, such as the `import path`, please refer to the training script!

## Main

Expand Down Expand Up @@ -81,6 +81,16 @@ And then replace the `path` to:
--validation_image=$PATH_TO_THE_REFERENCE_IMAGE_FILE_FOR_VALIDATION \
```

## DeepSpeed

When using `DeepSpeed` for training, you’ll notice the use of a `DeepSpeedWrapperModel` in [training script](train_svd.py#L837). This wrapper is necessary because DeepSpeed supports only a single model for parallel training, allowing us to encapsulate different modules, including ControlNet and UNet.

To perform inference with your trained weights, follow these steps:

1. Convert the generated weights to a `.bin` file using `zero_to_fp32.py` generated by DeepSpeed (Under the generated weight directory). This will create a file named `pytorch_model.bin`.
2. Utilize the script [unwrap_deepspeed.py](utils/train_svd.py) to separate the modules into distinct dictionaries for ControlNet and UNet.
3. Provide the paths to these weights in your inference script.

## Meta info

Please construct the training dataset and provide a list of the data entries in a .json file. We give an example in `meta_info_example/meta_info.json` (the data list) and `meta_info_example/meta_info/1.json`(Detailed meta information for each single video recoarding the position and score):
Expand Down Expand Up @@ -115,4 +125,4 @@ It requires substantial memory for training, as we use a high resolution and lon
journal={arXiv preprint arXiv:2408.06070},
year={2024}
}
```
```

0 comments on commit ab4b3ac

Please sign in to comment.