Skip to content

torch.cuda.Out Of Memory Error #8

Open
@Fcl1111

Description

My graphics card is RTX4060, 8GIB. I want to ask if there is any solution besides changing the graphics card. If I change the graphics card, what are the configuration requirements? Thank you.

[INFO] loading stable diffusion...
Loading pipeline components...: 100%|██████████| 6/6 [00:07<00:00, 1.26s/it]
[INFO] loaded stable diffusion!
Step: 0%| | 0/10001 [00:14<?, ?it/s]elapsed_time=14.63s | step=0 | loss=1.00 | n_rendering_samples=2259466 | max_depth=1.691 |
[INFO] Saved checkpoint at log/peacock/ckpt/ckpt.pth
Step: 0%| | 0/10001 [00:14<?, ?it/s]
Eval: 0%| | 0/5 [00:00<?, ?it/s]
Eval: 20%|██ | 1/5 [00:00<00:02, 1.40it/s]
Eval: 40%|████ | 2/5 [00:01<00:01, 1.68it/s]
Eval: 60%|██████ | 3/5 [00:01<00:01, 1.79it/s]
Eval: 80%|████████ | 4/5 [00:02<00:00, 1.87it/s]
Eval: 100%|██████████| 5/5 [00:02<00:00, 1.83it/s]
Step: 0%| | 17/10001 [02:27<24:08:20, 8.70s/it]
Traceback (most recent call last):
File "E:\Download\Diffusion Model Review\文本3D生成\基于扩散模型的方法\dreamfusionacc\train.py", line 181, in
loss = guidance.sds(
File "E:\Download\Diffusion Model Review\文本3D生成\基于扩散模型的方法\dreamfusionacc\guidance\stable_diffusion.py", line 167, in sds
noise_pred = self.unet(
File "E:\ProgramData\tinycudann\lib\site-packages\torch\nn\modules\module.py", line 1190, in _call_impl
return forward_call(*input, **kwargs)
File "E:\ProgramData\tinycudann\lib\site-packages\diffusers\models\unets\unet_2d_condition.py", line 1216, in forward
sample, res_samples = downsample_block(
File "E:\ProgramData\tinycudann\lib\site-packages\torch\nn\modules\module.py", line 1190, in _call_impl
return forward_call(*input, **kwargs)
File "E:\ProgramData\tinycudann\lib\site-packages\diffusers\models\unets\unet_2d_blocks.py", line 1288, in forward
hidden_states = attn(
File "E:\ProgramData\tinycudann\lib\site-packages\torch\nn\modules\module.py", line 1190, in _call_impl
return forward_call(*input, **kwargs)
File "E:\ProgramData\tinycudann\lib\site-packages\diffusers\models\transformers\transformer_2d.py", line 442, in forward
hidden_states = block(
File "E:\ProgramData\tinycudann\lib\site-packages\torch\nn\modules\module.py", line 1190, in _call_impl
return forward_call(*input, **kwargs)
File "E:\ProgramData\tinycudann\lib\site-packages\diffusers\models\attention.py", line 507, in forward
attn_output = self.attn1(
File "E:\ProgramData\tinycudann\lib\site-packages\torch\nn\modules\module.py", line 1190, in _call_impl
return forward_call(*input, **kwargs)
File "E:\ProgramData\tinycudann\lib\site-packages\diffusers\models\attention_processor.py", line 495, in forward
return self.processor(
File "E:\ProgramData\tinycudann\lib\site-packages\diffusers\models\attention_processor.py", line 772, in call
attention_probs = attn.get_attention_scores(query, key, attention_mask)
File "E:\ProgramData\tinycudann\lib\site-packages\diffusers\models\attention_processor.py", line 575, in get_attention_scores
attention_scores = torch.baddbmm(
torch.cuda.OutOfMemoryError: CUDA out of memory. Tried to allocate 320.00 MiB (GPU 0; 8.00 GiB total capacity; 9.73 GiB already allocated; 0 bytes free; 9.85 GiB reserved in total by PyTorch) If reserved memory is >> allocated memory try setting max_split_size_mb to avoid fragmentation. See documentation for Memory Management and PYTORCH_CUDA_ALLOC_CONF

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions