Porting DeepLab-ResNet from Caffe to TensorFlow, circa 2017
A faithful TensorFlow re-implementation of the DeepLab-ResNet semantic segmentation model, complete with Caffe weight conversion and multi-scale training.

What it does
This repo rebuilds the DeepLab-ResNet architecture in TensorFlow for pixel-level semantic segmentation on PASCAL VOC. It includes training, evaluation, and inference scripts, plus utilities to convert the original Caffe weights into TensorFlow checkpoints. The model uses a fully-convolutional ResNet-101 backbone with atrous (dilated) convolutions and atrous spatial pyramid pooling.
The interesting bit
The real grunt work is in the Caffe-to-TensorFlow conversion pipeline. The authors patched caffe-tensorflow to handle atrous convolution and batch normalization for both training and inference, then wrapped the whole thing in scripts so you don’t have to wrestle with .caffemodel files yourself. There’s also a multi-scale training script (train_msc.py) that aggregates losses across 0.5×, 0.75×, and full-resolution inputs, mimicking the original paper’s setup.
Key highlights
- Pre-converted checkpoints available (no manual Caffe conversion required)
- Single-scale model hits 86.9% mIoU on PASCAL VOC 2012 validation without CRF post-processing
- Supports custom datasets via
--num-classes,--ignore-label, and--not-restore-lastflags - Gradient accumulation in
train_msc.pylets you simulate larger batches on limited GPU memory - TensorBoard image summaries and data augmentation (random mirror, random scale) built in
Caveats
- Stuck on Python 2.7 and TensorFlow 1.1.0; Python 3 “will likely require some minor modifications”
- CRF post-processing is listed as a missing feature, with implementation only on a separate branch
- The README contains a broken link (a GitHub URL pasted mid-sentence in the dataset instructions)
Verdict
Worth a look if you need a working 2017-era DeepLabv2 reference in TensorFlow or want to study the Caffe conversion mechanics. Skip it if you’re starting fresh—modern frameworks and newer DeepLab versions have made this largely a historical artifact.