Skip to content

Commit

Permalink
add comment for batch_size
Browse files Browse the repository at this point in the history
  • Loading branch information
seasonSH committed Oct 4, 2023
1 parent 3225e02 commit d5be540
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 8 deletions.
6 changes: 1 addition & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,6 @@ pip install ninja
pip install -r requirements.txt
```

- (Optional, Recommended) The best-performing models in threestudio use the newly-released T2I model [DeepFloyd IF](https://github.com/deep-floyd/IF), which currently requires signing a license agreement. If you would like to use these models, you need to [accept the license on the model card of DeepFloyd IF](https://huggingface.co/DeepFloyd/IF-I-XL-v1.0), and login into the Hugging Face hub in the terminal by `huggingface-cli login`.

- For contributors, see [here](https://github.com/threestudio-project/threestudio#contributing-to-threestudio).

### Install MVDream
MVDream multi-view diffusion model is provided in a different codebase. Install it by:

Expand Down Expand Up @@ -101,7 +97,7 @@ python launch.py --config path/to/trial/dir/configs/parsed.yaml --train --gpu 0
```

## Tips

- **Preview**. Generating 3D content with SDS would a take a lot of time. So we suggest to use the 2D multi-view image generation [MVDream](https://github.com/bytedance/MVDream) to test if the model can really understand the text before using it for 3D generation.
- **Rescale Factor**. We introducte rescale adjustment from [Shanchuan et al.](https://arxiv.org/abs/2305.08891) to alleviate the texture over-saturation from large CFG guidance. However, in some cases, we find it to cause floating noises in the generated scene and consequently OOM issue. Therefore we reduce the rescale factor from 0.7 in original paper to 0.5. However, if you still encounter such a problem, please try to further reduce `system.guidance.recon_std_rescale=0.3`.

## Credits
Expand Down
2 changes: 1 addition & 1 deletion configs/mvdream-sd21-shading.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ seed: 0

data_type: "random-multiview-camera-datamodule"
data:
batch_size: [8,4]
batch_size: [8,4] # must be dividable by n_view
n_view: 4
# 0-4999: 64x64, >=5000: 256x256
width: [64, 256]
Expand Down
2 changes: 1 addition & 1 deletion configs/mvdream-sd21.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ seed: 0

data_type: "random-multiview-camera-datamodule"
data:
batch_size: [8,4]
batch_size: [8,4] # must be dividable by n_view
n_view: 4
# 0-4999: 64x64, >=5000: 256x256
width: [64, 256]
Expand Down
2 changes: 1 addition & 1 deletion threestudio/data/random_multiview.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def __init__(self, *args, **kwargs):
self.zoom_range = self.cfg.zoom_range

def collate(self, batch) -> Dict[str, Any]:
assert self.batch_size % self.cfg.n_view == 0
assert self.batch_size % self.cfg.n_view == 0, f"batch_size ({self.batch_size}) must be dividable by n_view ({self.cfg.n_view})!"
real_batch_size = self.batch_size // self.cfg.n_view

# sample elevation angles
Expand Down

0 comments on commit d5be540

Please sign in to comment.