I’m having issues on training with cpu

Rexedoziem: <p><div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/3X/a/d/adead7b2be4eea69884907686c69535518e19880.jpeg" data-download-href="https://discuss.pytorch.org/uploads/default/adead7b2be4eea69884907686c69535518e19880" title="image"><img src="https://discuss.pytorch.org/uploads/default/optimized/3X/a/d/adead7b2be4eea69884907686c69535518e19880_2_375x500.jpeg" alt="image" data-base62-sha1="oOxKw3KLyZDnNnvnJjjvs2xm3wk" width="375" height="500" srcset="https://discuss.pytorch.org/uploads/default/optimized/3X/a/d/adead7b2be4eea69884907686c69535518e19880_2_375x500.jpeg, https://discuss.pytorch.org/uploads/default/optimized/3X/a/d/adead7b2be4eea69884907686c69535518e19880_2_562x750.jpeg 1.5x, https://discuss.pytorch.org/uploads/default/optimized/3X/a/d/adead7b2be4eea69884907686c69535518e19880_2_750x1000.jpeg 2x" data-dominant-color="8A8279"><div class="meta"><svg class="fa d-icon d-icon-far-image svg-icon" aria-hidden="true"><use href="#far-image"></use></svg><span class="filename">image</span><span class="informations">1920×2560 504 KB</span><svg class="fa d-icon d-icon-discourse-expand svg-icon" aria-hidden="true"><use href="#discourse-expand"></use></svg></div></a></div></p>

ptrblck: <p>Could you please describe the issue in detail and in the best case post a minimal, executable code snippet which reproduces the error, so that we could directly debug it?<br>
You can post code snippets by wrapping them into three backticks ```.</p>

Rexedoziem: <p>I tried training the model, because I used Debertav3large, and the error was cuda was out of memory, I reduced the batch size and also changed some parameters, but still the same thing?</p>

ptrblck: <p>Based on your screenshot it seems you are passing a <code>LambdaLR</code> object as the <code>device</code> argument to the <code>to()</code> operation and your topic also mentions issues on the CPU?<br>
Could you clarify the issue a bit more, please?</p>

Rexedoziem: <p>Can I send in screenshot</p>

Rexedoziem: <p><div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/3X/b/c/bcd359b070daa68aaba38543b84704c696092660.png" data-download-href="https://discuss.pytorch.org/uploads/default/bcd359b070daa68aaba38543b84704c696092660" title="image"><img src="https://discuss.pytorch.org/uploads/default/optimized/3X/b/c/bcd359b070daa68aaba38543b84704c696092660_2_690x387.png" alt="image" data-base62-sha1="qWqzZm6xSZIp86qImskLdQ8D4QM" width="690" height="387" srcset="https://discuss.pytorch.org/uploads/default/optimized/3X/b/c/bcd359b070daa68aaba38543b84704c696092660_2_690x387.png, https://discuss.pytorch.org/uploads/default/optimized/3X/b/c/bcd359b070daa68aaba38543b84704c696092660_2_1035x580.png 1.5x, https://discuss.pytorch.org/uploads/default/original/3X/b/c/bcd359b070daa68aaba38543b84704c696092660.png 2x" data-dominant-color="D2D3D5"><div class="meta"><svg class="fa d-icon d-icon-far-image svg-icon" aria-hidden="true"><use href="#far-image"></use></svg><span class="filename">image</span><span class="informations">1366×768 122 KB</span><svg class="fa d-icon d-icon-discourse-expand svg-icon" aria-hidden="true"><use href="#discourse-expand"></use></svg></div></a></div></p>

Rexedoziem: <p><div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/3X/e/d/ed26d49039fa7ad21381591360b6eed831562e87.png" data-download-href="https://discuss.pytorch.org/uploads/default/ed26d49039fa7ad21381591360b6eed831562e87" title="image"><img src="https://discuss.pytorch.org/uploads/default/optimized/3X/e/d/ed26d49039fa7ad21381591360b6eed831562e87_2_690x387.png" alt="image" data-base62-sha1="xPWlX6vMwc68Zuoyb4kqzakbziT" width="690" height="387" srcset="https://discuss.pytorch.org/uploads/default/optimized/3X/e/d/ed26d49039fa7ad21381591360b6eed831562e87_2_690x387.png, https://discuss.pytorch.org/uploads/default/optimized/3X/e/d/ed26d49039fa7ad21381591360b6eed831562e87_2_1035x580.png 1.5x, https://discuss.pytorch.org/uploads/default/original/3X/e/d/ed26d49039fa7ad21381591360b6eed831562e87.png 2x" data-dominant-color="CFD1D3"><div class="meta"><svg class="fa d-icon d-icon-far-image svg-icon" aria-hidden="true"><use href="#far-image"></use></svg><span class="filename">image</span><span class="informations">1366×768 134 KB</span><svg class="fa d-icon d-icon-discourse-expand svg-icon" aria-hidden="true"><use href="#discourse-expand"></use></svg></div></a></div></p>

Rexedoziem: <p><div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/3X/5/d/5da425b703939a35eae55985195062469ef3445c.png" data-download-href="https://discuss.pytorch.org/uploads/default/5da425b703939a35eae55985195062469ef3445c" title="image"><img src="https://discuss.pytorch.org/uploads/default/optimized/3X/5/d/5da425b703939a35eae55985195062469ef3445c_2_690x387.png" alt="image" data-base62-sha1="dmo5veDBzmyvHTOkR4kPYBKyW3a" width="690" height="387" srcset="https://discuss.pytorch.org/uploads/default/optimized/3X/5/d/5da425b703939a35eae55985195062469ef3445c_2_690x387.png, https://discuss.pytorch.org/uploads/default/optimized/3X/5/d/5da425b703939a35eae55985195062469ef3445c_2_1035x580.png 1.5x, https://discuss.pytorch.org/uploads/default/original/3X/5/d/5da425b703939a35eae55985195062469ef3445c.png 2x" data-dominant-color="D0D2D3"><div class="meta"><svg class="fa d-icon d-icon-far-image svg-icon" aria-hidden="true"><use href="#far-image"></use></svg><span class="filename">image</span><span class="informations">1366×768 133 KB</span><svg class="fa d-icon d-icon-discourse-expand svg-icon" aria-hidden="true"><use href="#discourse-expand"></use></svg></div></a></div></p>

Rexedoziem: <p><div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/3X/d/b/db5b430e0e590f82899ac5cc8417f161939fccc2.png" data-download-href="https://discuss.pytorch.org/uploads/default/db5b430e0e590f82899ac5cc8417f161939fccc2" title="image"><img src="https://discuss.pytorch.org/uploads/default/optimized/3X/d/b/db5b430e0e590f82899ac5cc8417f161939fccc2_2_690x387.png" alt="image" data-base62-sha1="viw5ODzY3O621qTdBj8OUwyeN9w" width="690" height="387" srcset="https://discuss.pytorch.org/uploads/default/optimized/3X/d/b/db5b430e0e590f82899ac5cc8417f161939fccc2_2_690x387.png, https://discuss.pytorch.org/uploads/default/optimized/3X/d/b/db5b430e0e590f82899ac5cc8417f161939fccc2_2_1035x580.png 1.5x, https://discuss.pytorch.org/uploads/default/original/3X/d/b/db5b430e0e590f82899ac5cc8417f161939fccc2.png 2x" data-dominant-color="CFD1D3"><div class="meta"><svg class="fa d-icon d-icon-far-image svg-icon" aria-hidden="true"><use href="#far-image"></use></svg><span class="filename">image</span><span class="informations">1366×768 135 KB</span><svg class="fa d-icon d-icon-discourse-expand svg-icon" aria-hidden="true"><use href="#discourse-expand"></use></svg></div></a></div></p>

ptrblck: <p>No, please don’t post screenshots as they are not helpful.<br>
Describe your issue in words and post code snippets by wrapping them into three backticks ``` as previously mentioned.</p>

Rexedoziem: <p>I noticed that I didn’t place in the model which I’m using ( debertav2large) in the init function when declaring the variables, it worked afterwards, but to say the issues I ran into when training my model was that: cuda was out of memory, that’s the point I’m stuck when training, so I need assistance there?</p>

AbdulsalamBande: <p>Make sure that all your tensors and model are on the same device. Also make sure that batches on data fit into the GPU memory.</p>

Rexedoziem: <p>I think the model is too large for only one gpu used in kaggle</p>

AbdulsalamBande: <p>You could try smaller batch size.</p>

Rexedoziem: <p>Thanks, and maybe I’ll try smaller models too</p>

FlankCoder: <p>May be kaggle is ineeficient for this model tonuse with cpu because maybe its a vast model you could go with the gpu because gpu is paralleli computed the value or use smller batch size its totally depend on you</p>

Rexedoziem: <p>I used GPU on this one and my batch size for training and validation is 16, 8 respectively. So I don’t know if I’m to lower it or something else?</p>