skillfed

tf-slim

TensorFlow-Slim: A lightweight library for defining, training and evaluating complex models in TensorFlow

tf-slim v1.1.0 133.0K downloads/30d#11,532 on PyPI373
Permissive license Apache 2.0 Active released

What it is and what it does

TensorFlow-Slim is a lightweight library that sits on top of TensorFlow to reduce boilerplate when building neural networks. It provides argument scoping to set default parameters across operations, high-level layer definitions, variable management utilities that distinguish between model and non-model variables, and pre-built implementations of popular computer vision architectures like VGG and AlexNet. It also includes training and evaluation routines, loss functions, metrics, regularizers, and data-loading utilities.

You use it by importing as `tf_slim` and calling its layers and utilities instead of writing raw TensorFlow operations. It is designed to mix freely with native TensorFlow code, so you can adopt it incrementally. The library targets developers building convolutional neural networks and other deep learning models who want to reduce repetitive code and improve readability.

Use it for:

  • Define convolutional neural networks compactly using slim layers instead of native operations
  • Reuse pre-trained VGG or AlexNet models as starting points or feature extractors for transfer learning
  • Manage model variables separately from training variables for easier checkpoint saving and loading
  • Apply regularization and common loss functions without writing custom code
  • Train models with built-in learning routines and evaluate using standard metrics

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

TensorFlow-Slim provides high-level layers, variable management, and training utilities that simplify defining, training, and evaluating neural network models in TensorFlow.

Yes, if you are working with TensorFlow 1.x or early TensorFlow 2.x and need to reduce model-definition boilerplate. No, if you are starting a new project—modern TensorFlow and Keras provide equivalent or superior APIs natively. The package is stable and permissively licensed, but has not been updated since 2020 and may not be compatible with the latest TensorFlow versions.

Install

tf-slim on PyPI

pip

pip install tf-slim

uv

uv add tf-slim

poetry

poetry add tf-slim

Installing tf-slim

Before you install

Low friction to install; depends only on absl-py. Maintenance is active with recent commits, though the latest release was 2020-05-07 and the package has not received updates for several years despite the repository remaining active.

License in practice

Licensed under Apache 2.0 (permissive), allowing free use, modification, and distribution with minimal restrictions—suitable for both open-source and commercial projects.

Quickstart

pip install tf-slim

import tf_slim as slim

# Define a model using slim layers and variables
weights = slim.model_variable('weights', shape=[10, 10, 3, 3], initializer=tf.truncated_normal_initializer(stddev=0.1), regularizer=slim.l2_regularizer(0.05))

Requires TensorFlow 1.15.2 or TensorFlow 2.0–2.2; compatibility with TensorFlow versions beyond 2.2 is unverified.

Verify before relying

  • Whether version 1.1.0 remains compatible with current TensorFlow releases beyond those tested (TF 1.15.2, 2.0.1, 2.1, 2.2)
  • Current status of pre-built models (VGG, AlexNet) and whether they are maintained or deprecated
  • Whether this package is still recommended for new projects or superseded by native TensorFlow APIs
  • Specific code examples and their expected outputs to verify current functionality

Package facts

License Apache 2.0 (permissive)
Python support not specified
Install friction low — pure-Python wheel
Runtime dependencies 1 — absl-py
Maintenance actively maintained — 2,290 days since the last release
Last repo commit
First released
Downloads 132,995/month — #11,532 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: tf_slim-1.1.0-py2.py3-none-any.whl

Keywords: tensorflow, tf-slim, python, machine, learning

Development Status :: 4 - BetaIntended Audience :: DevelopersIntended Audience :: EducationIntended Audience :: Science/ResearchLicense :: OSI Approved :: Apache Software LicenseProgramming Language :: Python :: 2Programming Language :: Python :: 2.7Programming Language :: Python :: 3Programming Language :: Python :: 3.4Programming Language :: Python :: 3.5Programming Language :: Python :: 3.6Topic :: Scientific/EngineeringTopic :: Scientific/Engineering :: Artificial IntelligenceTopic :: Scientific/Engineering :: MathematicsTopic :: Software DevelopmentTopic :: Software Development :: LibrariesTopic :: Software Development :: Libraries :: Python Modules

Tags

tensorflow model definitionneural network layers tensorflowtensorflow training utilitiesdeep learning model buildingtensorflow regularizationcomputer vision models tensorflow
tensorflowneural-networkscomputer-vision

More Software Development packages