#Fine-tuning on kaggle environment
25 messages · Page 1 of 1 (latest)
There is no special config required for Unsloth to run on Kaggle versus Colab, but some users report that training can hang or the kernel can die on Kaggle, especially with certain GPUs (e.g., P100 vs T4) or large models. Switching to a T4 GPU, reducing batch size, or using SFTConfig instead of TrainingArguments can help. Also, ensure your package versions (transformers, trl, unsloth) match those used in working Colab runs, and try manually tokenizing your dataset if you encounter tokenization errors or kernel crashes. See this issue and this issue for details.
Would you like a step-by-step troubleshooting guide for Kaggle-specific hangs or kernel deaths?
Sources:
@shut falcon I'm using T4 and SFTConfig and the latest packages.
If you are using a T4 GPU, SFTConfig, and the latest packages, but training still pauses or does not proceed on Kaggle, this is a known issue for some users. The most common solutions are:
- Reduce batch size (e.g., set
per_device_train_batch_size=1) and/ormax_seq_length(e.g., 1024 or lower). - Restart the kernel and ensure no other processes are using GPU memory.
- Check for version mismatches—make sure
transformers,trl, andunslothare all up to date and match the versions used in official Unsloth notebooks. - Try running the same code on Colab—if it works there, the issue is likely Kaggle-specific resource or environment limitations.
See this issue and this issue for more troubleshooting.
Would you like more detailed steps or a sample minimal working Kaggle notebook?
Sources:
Try without wandb
@pseudo osprey how would I disable wandb.
report_to = "none",
np
if you want to use wandb use
!wandb login token
replace token with your token 
There’s an accelerator with 2xT4. Are you using both GPUs, or just one here?
I'm using both
I will try that
Wait how did you set that up? Was it just accelerate on kaggle?
Ah makes sense thanks!
Wait which model are you using? I was trying with Gemma 3n but was running into errors
unsloth/gemma-3n-E2B-it-unsloth-bnb-4bit
Oh shoot, guess I’ll be trying again then, thanks!
Welp that was some stupid sh*t, I ended up using accelerate instead of opensloth, but I eventually got kaggle to stop loading both model weights into one GPU at first
don't use device_map="auto"...
That sounds good