RuntimeError: CUDA out of memory for the svoice repo

username: Sid-5137
cooked: <p>While running this <a href="https://github.com/facebookresearch/svoice/tree/main" rel="noopener nofollow ugc">repo</a>. I am getting this error -</p>
<pre><code class="lang-auto">(svoice) (base) sid@Sid-PC:~/Desktop/Samsung_Project/Research/svoice$ python train.py
[2024-02-19 17:01:49,284][__main__][INFO] - For logs, checkpoints and samples check /home/sid/Desktop/Samsung_Project/Research/svoice/outputs/exp_
[2024-02-19 17:01:54,835][__main__][INFO] - Running on host Sid-PC
[2024-02-19 17:01:54,918][__main__][ERROR] - Some error happened
Traceback (most recent call last):
 File "train.py", line 118, in main
   _main(args)
 File "train.py", line 112, in _main
   run(args)
 File "train.py", line 59, in run
   assert args.batch_size % distrib.world_size == 0
AssertionError
(svoice) (base) sid@Sid-PC:~/Desktop/Samsung_Project/Research/svoice$ python train.py
[2024-02-19 17:02:06,334][__main__][INFO] - For logs, checkpoints and samples check /home/sid/Desktop/Samsung_Project/Research/svoice/outputs/exp_
[2024-02-19 17:02:11,862][__main__][INFO] - Running on host Sid-PC
[2024-02-19 17:02:14,669][svoice.solver][INFO] - ----------------------------------------------------------------------
[2024-02-19 17:02:14,669][svoice.solver][INFO] - Training...
[2024-02-19 17:02:15,075][__main__][ERROR] - Some error happened
Traceback (most recent call last):
 File "train.py", line 118, in main
   _main(args)
 File "train.py", line 112, in _main
   run(args)
 File "train.py", line 93, in run
   solver.train()
 File "/home/sid/Desktop/Samsung_Project/Research/svoice/svoice/solver.py", line 122, in train
   train_loss = self._run_one_epoch(epoch)
 File "/home/sid/Desktop/Samsung_Project/Research/svoice/svoice/solver.py", line 195, in _run_one_epoch
   estimate_source = self.dmodel(mixture)
 File "/home/sid/anaconda3/envs/svoice/lib/python3.7/site-packages/torch/nn/modules/module.py", line 722, in _call_impl
   result = self.forward(*input, **kwargs)
 File "/home/sid/Desktop/Samsung_Project/Research/svoice/svoice/models/swave.py", line 253, in forward
   output_all = self.separator(mixture_w)
 File "/home/sid/anaconda3/envs/svoice/lib/python3.7/site-packages/torch/nn/modules/module.py", line 722, in _call_impl
   result = self.forward(*input, **kwargs)
 File "/home/sid/Desktop/Samsung_Project/Research/svoice/svoice/models/swave.py", line 214, in forward
   output_all = self.rnn_model(enc_segments)
 File "/home/sid/anaconda3/envs/svoice/lib/python3.7/site-packages/torch/nn/modules/module.py", line 722, in _call_impl
   result = self.forward(*input, **kwargs)
 File "/home/sid/Desktop/Samsung_Project/Research/svoice/svoice/models/swave.py", line 108, in forward
   row_output = self.rows_grnn[i](row_input)
 File "/home/sid/anaconda3/envs/svoice/lib/python3.7/site-packages/torch/nn/modules/module.py", line 722, in _call_impl
   result = self.forward(*input, **kwargs)
 File "/home/sid/Desktop/Samsung_Project/Research/svoice/svoice/models/swave.py", line 43, in forward
   rnn_output, _ = self.rnn(output)
 File "/home/sid/anaconda3/envs/svoice/lib/python3.7/site-packages/torch/nn/modules/module.py", line 722, in _call_impl
   result = self.forward(*input, **kwargs)
 File "/home/sid/anaconda3/envs/svoice/lib/python3.7/site-packages/torch/nn/modules/rnn.py", line 577, in forward
   self.dropout, self.training, self.bidirectional, self.batch_first)
RuntimeError: CUDA out of memory. Tried to allocate 80.00 MiB (GPU 0; 3.81 GiB total capacity; 2.84 GiB already allocated; 48.69 MiB free; 2.96 GiB reserved in total by PyTorch)

</code></pre>
<p>So how to fix these runtime error.</p>

username: ptrblck
cooked: <p>You are running out of memory so try reducing the batch size if possible or use a smaller model.</p>