---------------------------------------------------------------------------
OutOfMemoryError Traceback (most recent call last)
/home/nipun.batra/git/blog/posts/siren-paper-implementation.ipynb Cell 41 in <module>
<a href='vscode-notebook-cell://ssh-remote%2B10.0.62.168/home/nipun.batra/git/blog/posts/siren-paper-implementation.ipynb#X54sdnNjb2RlLXJlbW90ZQ%3D%3D?line=0'>1</a> #losses_mlp_sin_3_128 = train_audio(X, audio, mlp_audio_sin_3_128, lr=0.0001,
<a href='vscode-notebook-cell://ssh-remote%2B10.0.62.168/home/nipun.batra/git/blog/posts/siren-paper-implementation.ipynb#X54sdnNjb2RlLXJlbW90ZQ%3D%3D?line=1'>2</a> # epochs=5000, bs=len(X)//2, print_every=100)
----> <a href='vscode-notebook-cell://ssh-remote%2B10.0.62.168/home/nipun.batra/git/blog/posts/siren-paper-implementation.ipynb#X54sdnNjb2RlLXJlbW90ZQ%3D%3D?line=3'>4</a> losses_mlp_sin_5_256 = train_audio(X, audio, mlp_audio_sin_5_256, lr=0.0001,
<a href='vscode-notebook-cell://ssh-remote%2B10.0.62.168/home/nipun.batra/git/blog/posts/siren-paper-implementation.ipynb#X54sdnNjb2RlLXJlbW90ZQ%3D%3D?line=4'>5</a> epochs=5000, bs=len(X)//2, print_every=100)
/home/nipun.batra/git/blog/posts/siren-paper-implementation.ipynb Cell 41 in train_audio(X, y, model, lr, epochs, bs, print_every)
<a href='vscode-notebook-cell://ssh-remote%2B10.0.62.168/home/nipun.batra/git/blog/posts/siren-paper-implementation.ipynb#X54sdnNjb2RlLXJlbW90ZQ%3D%3D?line=9'>10</a> pred_y = model(batch_X)
<a href='vscode-notebook-cell://ssh-remote%2B10.0.62.168/home/nipun.batra/git/blog/posts/siren-paper-implementation.ipynb#X54sdnNjb2RlLXJlbW90ZQ%3D%3D?line=11'>12</a> # Compute the loss
---> <a href='vscode-notebook-cell://ssh-remote%2B10.0.62.168/home/nipun.batra/git/blog/posts/siren-paper-implementation.ipynb#X54sdnNjb2RlLXJlbW90ZQ%3D%3D?line=12'>13</a> loss = criterion(pred_y, batch_y)
<a href='vscode-notebook-cell://ssh-remote%2B10.0.62.168/home/nipun.batra/git/blog/posts/siren-paper-implementation.ipynb#X54sdnNjb2RlLXJlbW90ZQ%3D%3D?line=14'>15</a> # Zero gradients, perform a backward pass, and update the weights
<a href='vscode-notebook-cell://ssh-remote%2B10.0.62.168/home/nipun.batra/git/blog/posts/siren-paper-implementation.ipynb#X54sdnNjb2RlLXJlbW90ZQ%3D%3D?line=15'>16</a> optimizer.zero_grad()
File ~/miniforge3/lib/python3.9/site-packages/torch/nn/modules/module.py:1501, in Module._call_impl(self, *args, **kwargs)
1496 # If we don't have any hooks, we want to skip the rest of the logic in
1497 # this function, and just call forward.
1498 if not (self._backward_hooks or self._backward_pre_hooks or self._forward_hooks or self._forward_pre_hooks
1499 or _global_backward_pre_hooks or _global_backward_hooks
1500 or _global_forward_hooks or _global_forward_pre_hooks):
-> 1501 return forward_call(*args, **kwargs)
1502 # Do not call functions when jit is used
1503 full_backward_hooks, non_full_backward_hooks = [], []
File ~/miniforge3/lib/python3.9/site-packages/torch/nn/modules/loss.py:536, in MSELoss.forward(self, input, target)
535 def forward(self, input: Tensor, target: Tensor) -> Tensor:
--> 536 return F.mse_loss(input, target, reduction=self.reduction)
File ~/miniforge3/lib/python3.9/site-packages/torch/nn/functional.py:3295, in mse_loss(input, target, size_average, reduce, reduction)
3292 reduction = _Reduction.legacy_get_string(size_average, reduce)
3294 expanded_input, expanded_target = torch.broadcast_tensors(input, target)
-> 3295 return torch._C._nn.mse_loss(expanded_input, expanded_target, _Reduction.get_enum(reduction))
OutOfMemoryError: CUDA out of memory. Tried to allocate 7.25 GiB (GPU 0; 79.18 GiB total capacity; 63.06 GiB already allocated; 7.88 MiB free; 74.24 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