Skip to content

[Bug][Examples] TextCNN.ipynb is broken due to legacy torchtext 0.9.1 dependency #3521

@TahaZahid05

Description

@TahaZahid05

Hi there!

While working on updates to the examples directory, I identified that examples/notebooks/TextCNN.ipynb is currently unusable in modern Python/Torch environments. The notebook explicitly attempts to install torchtext==0.9.1, which creates a fundamental version conflict with the core library requirements.

  • Project Python Requirement: >=3.9, <=3.13
  • Project Torch Requirement: >=1.10, <3

torchtext 0.9.1 was built for torch 1.8.1. Because the project now requires torch >= 1.10, attempting to force-install the legacy version causes a binary mismatch.

In a Python 3.10 / Torch 2.x environment, importing the library results in the following crash:

OSError: /.../site-packages/torchtext/lib/libtorchtext.so: undefined symbol: _ZN5torch6detail10class_baseC2ERKSsS3_SsRKSt9type_infoS6_

The notebook requires a refactor to remove the torchtext dependency entirely.

I am documenting this issue here as it falls outside the scope of my current PR (which focuses on pbar clean-up), but it remains an inconvenience for users trying to follow this tutorial.

I am happy to work on this refactor in a separate follow-up PR if assigned to this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions