← all repositories
taehoonlee/tensornets

TensorFlow model zoo that treats networks as plain functions, not objects

TensorNets gives you ResNet, YOLO, and friends as simple functions returning tf.Tensor, with pre-trained weights and a side of old-school TF 1.x sessions.

tensornets
Velocity · 7d
+0.3
★ / day
Trend
steady
star history

What it does TensorNets is a collection of 25+ computer vision architectures—ResNet, DenseNet, EfficientNet, YOLO variants, Faster R-CNN, and more—implemented as plain functions in TensorFlow. Each model takes a tf.Tensor and returns a tf.Tensor, with pre-trained weights and preprocessing available via .pretrained() and .preprocess() methods. It covers image classification and object detection, and includes utilities for inspecting intermediate layers, weights, and model summaries.

The interesting bit The author claims all Inception variants fit in ~500 lines versus 2000+ in Google’s official models, achieved by using tf.contrib.layers and avoiding custom classes entirely. The object detection models are decoupled from their “stem” backbones—you can pair YOLOv2 with any network in the library, not just the default Darknet19.

Key highlights

  • Supports TensorFlow 1.4 through 2.1 (with compatibility shims for TF 2)
  • Pre-trained weights available for all classification models; ImageNet validation accuracies and inference speeds benchmarked on Tesla P100
  • Introspection methods: middles(), outputs(), weights(), summary() for debugging and feature extraction
  • Multi-GPU usage shown in examples; transfer learning with custom class counts supported via is_training=True
  • Object detection requires manual ROI pooling setup for Faster R-CNN, and detection APIs vary slightly between YOLOv2, YOLOv3, and Faster R-CNN

Caveats

  • Built around tf.Session and tf.placeholder, making it a TF 1.x project with compatibility workarounds rather than native TF 2 / Keras
  • tf.contrib.layers is deprecated in modern TensorFlow, and the Travis CI badge suggests maintenance may have slowed
  • Faster R-CNN requires compiling a separate C++ ROI pooling extension with manual Makefile edits

Verdict Worth a look if you’re maintaining legacy TensorFlow 1.x pipelines and want drop-in, inspectable models without Keras abstraction overhead. Skip it if you’re on TF 2.x or later—modern tf.keras.applications or Hugging Face have superseded this approach.

heatdrop uses Google Analytics to see which pages get read — nothing else. Your call. How we handle data.