Guest User

error

a guest
Dec 30th, 2024
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.97 KB | None | 0 0
  1. OutOfMemoryError Traceback (most recent call last)
  2. <ipython-input-4-aa3f31ef5eca> in <cell line: 10>()
  3. 22 # Training the discriminator
  4. 23 discriminator.zero_grad()
  5. ---> 24 output_discriminator = discriminator(all_samples.to(device=device))
  6. 25 loss_discriminator = loss_function(output_discriminator, all_samples_labels.to(device=device))
  7. 26
  8.  
  9. /usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py in _wrapped_call_impl(self, *args, **kwargs)
  10. 1551 return self._compiled_call_impl(*args, **kwargs) # type: ignore[misc]
  11. 1552 else:
  12. -> 1553 return self._call_impl(*args, **kwargs)
  13. 1554
  14. 1555 def _call_impl(self, *args, **kwargs):
  15.  
  16. /usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py in _call_impl(self, *args, **kwargs)
  17. 1560 or _global_backward_pre_hooks or _global_backward_hooks
  18. 1561 or _global_forward_hooks or _global_forward_pre_hooks):
  19. -> 1562 return forward_call(*args, **kwargs)
  20. 1563
  21. 1564 try:
  22.  
  23. <ipython-input-2-abdec4b3329d> in forward(self, x)
  24. 57
  25. 58 def forward(self, x):
  26. ---> 59 return self.model(x)
  27. 60
  28. 61 discriminator = Discriminator().to(device=device)
  29.  
  30. /usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py in _wrapped_call_impl(self, *args, **kwargs)
  31. 1551 return self._compiled_call_impl(*args, **kwargs) # type: ignore[misc]
  32. 1552 else:
  33. -> 1553 return self._call_impl(*args, **kwargs)
  34. 1554
  35. 1555 def _call_impl(self, *args, **kwargs):
  36.  
  37. /usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py in _call_impl(self, *args, **kwargs)
  38. 1560 or _global_backward_pre_hooks or _global_backward_hooks
  39. 1561 or _global_forward_hooks or _global_forward_pre_hooks):
  40. -> 1562 return forward_call(*args, **kwargs)
  41. 1563
  42. 1564 try:
  43.  
  44. /usr/local/lib/python3.10/dist-packages/torch/nn/modules/container.py in forward(self, input)
  45. 217 def forward(self, input):
  46. 218 for module in self:
  47. --> 219 input = module(input)
  48. 220 return input
  49. 221
  50.  
  51. /usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py in _wrapped_call_impl(self, *args, **kwargs)
  52. 1551 return self._compiled_call_impl(*args, **kwargs) # type: ignore[misc]
  53. 1552 else:
  54. -> 1553 return self._call_impl(*args, **kwargs)
  55. 1554
  56. 1555 def _call_impl(self, *args, **kwargs):
  57.  
  58. /usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py in _call_impl(self, *args, **kwargs)
  59. 1560 or _global_backward_pre_hooks or _global_backward_hooks
  60. 1561 or _global_forward_hooks or _global_forward_pre_hooks):
  61. -> 1562 return forward_call(*args, **kwargs)
  62. 1563
  63. 1564 try:
  64.  
  65. /usr/local/lib/python3.10/dist-packages/torch/nn/modules/activation.py in forward(self, input)
  66. 102
  67. 103 def forward(self, input: Tensor) -> Tensor:
  68. --> 104 return F.relu(input, inplace=self.inplace)
  69. 105
  70. 106 def extra_repr(self) -> str:
  71.  
  72. /usr/local/lib/python3.10/dist-packages/torch/nn/functional.py in relu(input, inplace)
  73. 1498 result = torch.relu_(input)
  74. 1499 else:
  75. -> 1500 result = torch.relu(input)
  76. 1501 return result
  77. 1502
  78.  
  79. OutOfMemoryError: CUDA out of memory. Tried to allocate 4.00 GiB. GPU 0 has a total capacity of 14.74 GiB of which 1.71 GiB is free. Process 7476 has 13.03 GiB memory in use. Of the allocated memory 12.32 GiB is allocated by PyTorch, and 595.48 MiB is reserved by PyTorch but unallocated. If reserved but unallocated memory is large try setting PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True to avoid fragmentation. See documentation for Memory Management (https://pytorch.org/docs/stable/notes/cuda.html#environment-variables)
Advertisement
Add Comment
Please, Sign In to add comment