def verify_classes(model_name, num_classes):
    """Verify 'classes=??' in cfg matches user-specified num_classes."""
    cfg_file_path = model_name + '.cfg'
    with open(cfg_file_path, 'r') as f:
        cfg_lines = f.readlines()
    classes_lines = [l.strip() for l in cfg_lines if l.startswith('classes')]
    classes = [int(l.split('=')[-1]) for l in classes_lines]
    return all([c == num_classes for c in classes])