Skip to content

Fix broken Captum tutorial — remove retired Insights section, update requirements #3859

@svekars

Description

@svekars

Description

The Model Understanding with Captum tutorial has critical breakage: the Captum Insights section uses APIs that were fully removed from Captum in Feb 2026. The tutorial also has stale dependency requirements.

Changes needed

Critical — broken code

  • Remove Captum Insights section (lines ~400-499): AttributionVisualizer, Batch, ImageFeature, and visualizer.render() were deprecated in Captum v0.8.0 (Feb 2025) and fully removed from the codebase (Feb 2026). This entire section will crash on current Captum.
  • Remove from captum.insights import AttributionVisualizer, Batch
  • Remove from captum.insights.attr_vis.features import ImageFeature

Deprecated APIs

  • transforms.ToTensor()v2.ToImage() + v2.ToDtype(torch.float32, scale=True): ToTensor() is deprecated since torchvision 0.18.

Stale requirements

  • Python version: 3.63.9 or higher (Python 3.6 is EOL since Dec 2021; PyTorch 2.x requires 3.9+)
  • PyTorch version: Remove 1.2 or higher floor — it's ancient
  • TorchVision version: Remove 0.6 or higher floor
  • Flask dependency: Remove entirely — Flask was only needed for Captum Insights
  • Matplotlib pin: Remove matplotlib==3.3.4 / matplotlib=3.3.4 pin from both pip and conda install commands. The pin was for a Captum bug that was fixed long ago.
  • Conda install: Switch to pip-only (Captum v0.8.0 was the last conda release on the PyTorch channel)

Nice to have

  • Consider replacing the removed Insights section with an LLM Prompt Attribution example — this is the headline feature of Captum v0.8.0 and would modernize the tutorial to reflect current AI trends.

Files

cc @subramen

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions