Software 24 min

Train Resnet50 on ImageNet with PyTorch

Eighty lines of PyTorch — flips, rotation and ColorJitter for augmentation, DataParallel for multi-GPU, cross-entropy with Adam — fine-tune a pretrained ResNet-50 on the ImageNet Object Localization Challenge. Wrap it in a Dockerfile that pulls the dataset from Kaggle and you have a self-contained, reproducible 1000-class training pipeline.

Train Resnet50 on ImageNet with PyTorch
Programming 3 min

Find all tables without primary key in PostgreSQL

A single LEFT JOIN against information_schema.table_constraints exposes every BASE TABLE missing a PRIMARY KEY — the silent latency tax that creeps in through schema migrations and ad-hoc DDL. Audit the whole cluster, then narrow to a single schema with one extra WHERE clause.

Software 3 min

Fixing error 'Matplotlib is currently using agg'

Matplotlib falls back to its non-interactive Agg backend whenever there's no X11 display — which is the default state inside almost every container. The fix is two parts: install the GUI toolkit dependencies in the image, then forward the host's X socket into the container at run time.

Software 4 min

Monitor GPU utilization with nvidia-smi

When a training run is GPU-bound, the bottleneck is rarely the model — it's the data pipeline starving the device. nvidia-smi dmon turns into a live, one-line-per-second dashboard for utilisation, memory, power draw, temperature and PCIe throughput, parseable from any shell loop.

Software 1 min

Cleaning up Docker space

Docker accumulates state silently — stopped containers, dangling image layers, unattached volumes, orphaned networks. Four short commands, run in the right order, reclaim gigabytes safely without touching anything that's currently running or in use.