gen-efficientnet-pytorch  by rwightman

PyTorch image models for efficient architectures

created 6 years ago
1,575 stars

Top 27.1% on sourcepulse

GitHubView on GitHub
Project Summary

This repository provides PyTorch implementations of various efficient convolutional neural network architectures, including EfficientNet variants, MixNet, MobileNetV3/V2, and others. It offers pretrained weights for many models, enabling researchers and practitioners to leverage state-of-the-art computer vision models with ease.

How It Works

The project implements a flexible architecture definition system using string-based configurations to define block layouts. This approach allows for easy customization and experimentation with different network structures derived from the MobileNet V1/V2 block sequence. It also includes memory-efficient autograd functions for Swish/Mish activations and supports exporting models to ONNX and Caffe2 formats.

Quick Start & Requirements

  • Install: pip install geffnet
  • Prerequisites: PyTorch (versions 1.4, 1.5, 1.6 tested), Python 3.6-3.8. CUDA is recommended for GPU acceleration.
  • Usage: Models can be loaded via PyTorch Hub (torch.hub.load('rwightman/gen-efficientnet-pytorch', 'model_name', pretrained=True)) or directly using geffnet.create_model('model_name', pretrained=True).
  • Documentation: PyTorch Hub API, Pip Install

Highlighted Details

  • Implements a wide range of efficient architectures: EfficientNet (NoisyStudent, AdvProp, EdgeTPU, CondConv, Lite), MixNet, MNASNet, MobileNetV3/V2, FBNet, Single-Path NAS.
  • Provides extensive pretrained weights, with many achieving accuracies close to or exceeding original paper implementations.
  • Includes scripts for exporting models to ONNX and Caffe2, with validation and benchmarking utilities.
  • Supports memory-efficient Swish/Mish activations and torch.jit.script compatibility for many models.

Maintenance & Community

  • NOTE: This repository is not being maintained. Users are directed to use timm instead, which includes all these models and more.
  • The primary contributor is rwightman.

Licensing & Compatibility

  • The repository does not explicitly state a license in the README. However, it is common for such projects to be MIT or Apache licensed. Given the recommendation to use timm, which is Apache 2.0 licensed, commercial use is likely permissible.

Limitations & Caveats

  • The project is explicitly marked as not being maintained.
  • ONNX export and optimization compatibility can be fragile across PyTorch and ONNX version updates.
  • TF ported models with 'SAME' padding require specific export flags (config.set_exportable(True)) and may have fixed padding at export time.
Health Check
Last commit

1 year ago

Responsiveness

1 day

Pull Requests (30d)
0
Issues (30d)
0
Star History
8 stars in the last 90 days

Explore Similar Projects

Starred by Patrick von Platen Patrick von Platen(Core Contributor to Hugging Face Transformers and Diffusers), Michael Han Michael Han(Cofounder of Unsloth), and
1 more.

ktransformers by kvcache-ai

0.4%
15k
Framework for LLM inference optimization experimentation
created 1 year ago
updated 2 days ago
Feedback? Help us improve.