Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

训练模型时这个问题怎么办??疑似N卡内存不够。 CUDA out of memory. Tried to allocate 122.00 MiB (GPU 0; 4.00 GiB total capacity; 3.15 GiB already allocated; 0 bytes free; 3.45 GiB reserved in total by PyTorch #669

Closed
pzhyyd opened this issue Jul 21, 2022 · 9 comments

Comments

@pzhyyd
Copy link

pzhyyd commented Jul 21, 2022

Summary[问题简述(一句话)]
训练模型时这个问题怎么办??疑似N卡内存不够。
CUDA out of memory. Tried to allocate 122.00 MiB (GPU 0; 4.00 GiB total capacity; 3.15 GiB already allocated; 0 bytes free; 3.45 GiB reserved in total by PyTorch

Env & To Reproduce[复现与环境]
python3.9、NVIDIA GeForce GTX 1050Ti(4GB)

Screenshots[截图(如有)]
image
image

@pzhyyd
Copy link
Author

pzhyyd commented Jul 21, 2022

运行起来N卡的状态。
image

@pzhyyd
Copy link
Author

pzhyyd commented Jul 21, 2022

image

@VERT2022
Copy link

訓練模型顯存不足
訓練合成器時:將 synthesizer/hparams.py中的batch_size參數調小

//調整前
tts_schedule = [(2, 1e-3, 20_000, 12), # Progressive training schedule
(2, 5e-4, 40_000, 12), # (r, lr, step, batch_size)
(2, 2e-4, 80_000, 12), #
(2, 1e-4, 160_000, 12), # r = reduction factor (# of mel frames
(2, 3e-5, 320_000, 12), # synthesized for each decoder iteration)
(2, 1e-5, 640_000, 12)], # lr = learning rate
//調整後
tts_schedule = [(2, 1e-3, 20_000, 8), # Progressive training schedule
(2, 5e-4, 40_000, 8), # (r, lr, step, batch_size)
(2, 2e-4, 80_000, 8), #
(2, 1e-4, 160_000, 8), # r = reduction factor (# of mel frames
(2, 3e-5, 320_000, 8), # synthesized for each decoder iteration)
(2, 1e-5, 640_000, 8)], # lr = learning rate

@pzhyyd
Copy link
Author

pzhyyd commented Jul 22, 2022

是调整这个位置么

image

还是这里呢
image

@pzhyyd
Copy link
Author

pzhyyd commented Jul 22, 2022

image
gai'wei改为这样可以么

@babysor
Copy link
Owner

babysor commented Jul 22, 2022

差不多

@pzhyyd
Copy link
Author

pzhyyd commented Jul 22, 2022

訓練模型顯存不足 訓練合成器時:將 synthesizer/hparams.py中的batch_size參數調小

//調整前 tts_schedule = [(2, 1e-3, 20_000, 12), # Progressive training schedule (2, 5e-4, 40_000, 12), # (r, lr, step, batch_size) (2, 2e-4, 80_000, 12), # (2, 1e-4, 160_000, 12), # r = reduction factor (# of mel frames (2, 3e-5, 320_000, 12), # synthesized for each decoder iteration) (2, 1e-5, 640_000, 12)], # lr = learning rate //調整後 tts_schedule = [(2, 1e-3, 20_000, 8), # Progressive training schedule (2, 5e-4, 40_000, 8), # (r, lr, step, batch_size) (2, 2e-4, 80_000, 8), # (2, 1e-4, 160_000, 8), # r = reduction factor (# of mel frames (2, 3e-5, 320_000, 8), # synthesized for each decoder iteration) (2, 1e-5, 640_000, 8)], # lr = learning rate

感谢指导,已成功开始训练了

@pzhyyd pzhyyd closed this as completed Jul 22, 2022
@z1139147357
Copy link

我已经把batch_size调整到4了,还是出现同样的问题,唉。。。

@by517840374
Copy link

你是不是没装cuda?我没装之前也是这样,或者更换一下pytorch 版本

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants