Using nnU-Net with 2D RGB images and custom data splits

nnU-Net is now considered a standard and state-of-the-art tool for medical image segmentation, but, I think that it is opinionated in the following ways that affect how I may use it: It enforces a specific training and evaluation workflow, including assumptions about data splits. This means using custom train-valid-test splits requires some workarounds. It assumes 3D volumetric data, and while 2D data is supported, it’s the not the primary use case. It assumes grayscale images, and does not support RGB images out of the box. This again means that RGB images require some workarounds. A lot of researchers, however, happily use nnU-Net for 3D volumetric medical images, so these limitations may not be relevant to them. ...

January 17, 2026 · 5 min · Kumar Abhishek

Using HuggingFace Accelerate for mixed-precision training

Note: This post was originally written in 2021, but I have since updated it to reflect the latest changes in HuggingFace Accelerate (last update November 2025 using accelerate==1.11.0). For a grad course that recently concluded, the course project required me to train and evaluate a large number of models. Our school’s local SLURM cluster has new GPUs that support fp16, which meant I could take advantage of PyTorch’s Automatic Mixed Precision (AMP) training. And honestly, there is no reason not to use it: we get reduced memory usage, faster training, and all of this without virtually any loss in performance. ...

December 20, 2021 · 4 min · Kumar Abhishek