huggingface/pytorch-image-models · warning · FutureWarning

Importing from {__name__} is deprecated, please import via t

Error message

Importing from {__name__} is deprecated, please import via timm.models

What it means

Importing timm.models.fx_features is deprecated: it now lives at timm.models._features_fx and this shim re-exports it with a FutureWarning. Use timm.models imports for FeatureGraphNet / GraphExtractNet.

Source

Thrown at timm/models/fx_features.py:4

from ._features_fx import *

import warnings
warnings.warn(f"Importing from {__name__} is deprecated, please import via timm.models", FutureWarning)

View on GitHub (pinned to 9a5261e31b)

Solutions

  1. Import from timm.models instead: from timm.models import FeatureGraphNet
  2. Or use timm.models._features_fx for the private module path
  3. Update forks/plugins referencing the old filename

Example fix

# before
from timm.models.fx_features import FeatureGraphNet
# after
from timm.models import FeatureGraphNet
Defensive patterns

Strategy: validation

Validate before calling

from timm.models import FeatureGraphNet  # modern path

Prevention

When it happens

Trigger: from timm.models.fx_features import FeatureGraphNet, GraphExtractNet; import timm.models.fx_features in torch.fx-based feature extraction code.

Common situations: FX-tracing pipelines and feature-graph extraction scripts written for older timm versions.

Related errors


AI-assisted analysis of huggingface/pytorch-image-models@9a5261e31b (2026-08-27). Data as JSON: /api/errors/4fcfca9e68d4a93a. Report an issue: GitHub.