Skip to content

Colab tnpp-diaparse.ipynb fails with import error #40

@fergusq

Description

@fergusq

I get the following error when trying the notebook:

---------------------------------------------------------------------------

ModuleNotFoundError                       Traceback (most recent call last)

[<ipython-input-4-d883b15aac58>](https://localhost:8080/#) in <module>
----> 1 import pytorch_lightning

6 frames

[/usr/local/lib/python3.7/dist-packages/pytorch_lightning/utilities/apply_func.py](https://localhost:8080/#) in <module>
     29 if _TORCHTEXT_AVAILABLE:
     30     if _compare_version("torchtext", operator.ge, "0.9.0"):
---> 31         from torchtext.legacy.data import Batch
     32     else:
     33         from torchtext.data import Batch

ModuleNotFoundError: No module named 'torchtext.legacy'

Requiring an older version of torchtext should fix the problem, or updating pytorch_lightning to a newer version that doesn't use the legacy package.

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