Without doing anything to the code, just rerun, I get a different error.
Traceback (most recent call last):
File “S:\Desktop Folders\Bots\main (2).py”, line 155, in 
pred = model(X)
File “C:\Users\Marius\AppData\Local\Programs\Python\Python39\lib\site-packages\torch\nn\modules\module.py”, line 1102, in _call_impl
return forward_call(*input, **kwargs)
File “S:\Desktop Folders\Bots\main (2).py”, line 91, in forward
x = self.conv1(x)
File “C:\Users\Marius\AppData\Local\Programs\Python\Python39\lib\site-packages\torch\nn\modules\module.py”, line 1102, in _call_impl
return forward_call(*input, **kwargs)
File “C:\Users\Marius\AppData\Local\Programs\Python\Python39\lib\site-packages\torch\nn\modules\conv.py”, line 446, in forward
return self._conv_forward(input, self.weight, self.bias)
File “C:\Users\Marius\AppData\Local\Programs\Python\Python39\lib\site-packages\torch\nn\modules\conv.py”, line 442, in _conv_forward
return F.conv2d(input, weight, bias, self.stride,
RuntimeError: CUDA out of memory. Tried to allocate 126.00 MiB (GPU 0; 24.00 GiB total capacity; 48.11 MiB already allocated; 22.20 GiB free; 50.00 MiB 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
Sorry for the errors spam, just thought it may be useful since it points out 22GB of RAM free. At first I suspected it might have been memory shortage but now I really am clueless.
Again, thanks for all responses.