I tried to run the code on my own laptop and I got this error
Training starts.
#################### Epoch: 1 ####################
0%| | 0/9555 [00:00<?, ?it/s]
Traceback (most recent call last):
File "src/main.py", line 283, in
manager.train()
File "src/main.py", line 106, in train
outputs = self.model(
File "/home/reda/anaconda3/lib/python3.8/site-packages/torch/nn/modules/module.py", line 889, in _call_impl
result = self.forward(*input, **kwargs)
File "/home/reda/anaconda3/lib/python3.8/site-packages/transformers/models/gpt2/modeling_gpt2.py", line 941, in forward
transformer_outputs = self.transformer(
File "/home/reda/anaconda3/lib/python3.8/site-packages/torch/nn/modules/module.py", line 889, in _call_impl
result = self.forward(*input, **kwargs)
File "/home/reda/anaconda3/lib/python3.8/site-packages/transformers/models/gpt2/modeling_gpt2.py", line 789, in forward
outputs = block(
File "/home/reda/anaconda3/lib/python3.8/site-packages/torch/nn/modules/module.py", line 889, in _call_impl
result = self.forward(*input, **kwargs)
File "/home/reda/anaconda3/lib/python3.8/site-packages/transformers/models/gpt2/modeling_gpt2.py", line 317, in forward
attn_outputs = self.attn(
File "/home/reda/anaconda3/lib/python3.8/site-packages/torch/nn/modules/module.py", line 889, in _call_impl
result = self.forward(*input, **kwargs)
File "/home/reda/anaconda3/lib/python3.8/site-packages/transformers/models/gpt2/modeling_gpt2.py", line 258, in forward
attn_output, attn_weights = self._attn(query, key, value, attention_mask, head_mask)
File "/home/reda/anaconda3/lib/python3.8/site-packages/transformers/models/gpt2/modeling_gpt2.py", line 194, in _attn
attn_weights = self.attn_dropout(attn_weights)
File "/home/reda/anaconda3/lib/python3.8/site-packages/torch/nn/modules/module.py", line 889, in _call_impl
result = self.forward(*input, **kwargs)
File "/home/reda/anaconda3/lib/python3.8/site-packages/torch/nn/modules/dropout.py", line 58, in forward
return F.dropout(input, self.p, self.training, self.inplace)
File "/home/reda/anaconda3/lib/python3.8/site-packages/torch/nn/functional.py", line 1076, in dropout
return VF.dropout(input, p, training) if inplace else _VF.dropout(input, p, training)
RuntimeError: CUDA out of memory. Tried to allocate 192.00 MiB (GPU 0; 3.95 GiB total capacity; 2.92 GiB already allocated; 95.25 MiB free; 2.96 GiB reserved in total by PyTorch)