Skip to content
This repository was archived by the owner on Nov 22, 2022. It is now read-only.
This repository was archived by the owner on Nov 22, 2022. It is now read-only.

ModuleError when running xlm_r_tutorial.ipynb #1704

@Litsay

Description

@Litsay

Thanks for providing such a powerful tool for us! I am a freshman in NLP and I am interested in XLM-R recently. When I tried to run xlm_r_turorial.ipynb to get my start, I found it doesn't work. It seems to exist a folder named pytorch to provide PathManager Module in my understanding, but actually there isn't. I think it is because of the version, so I also tried v0.3.2 just as this turorial showed, but there are also lots of compatibility problems, such as accelerators in issue1612. So I turned you to give my some suggestions. Thank you for your help! :)

Steps to reproduce

  1. run xlm_r_tutorial.ipynb in Google CoLab
  2. from pytext import workflow

Observed Results

ModuleNotFoundError                       Traceback (most recent call last)
<ipython-input-5-fcf8f04b8050> in <module>()
      4 import torch
      5 
----> 6 from pytext import workflow
      7 from pytext.config.serialize import pytext_config_from_json
      8 from pytext.models.roberta import RoBERTa

6 frames
/usr/local/lib/python3.7/dist-packages/pytext/utils/file_io.py in <module>()
     10 # TODO: @stevenliu use PathManagerFactory after it's released to PyPI
     11 from iopath.common.file_io import HTTPURLHandler
---> 12 from pytorch.text.fb.utils import PATH_MANAGER as PathManager  # noqa
     13 

ModuleNotFoundError: No module named 'pytorch'

Expected Results

Run the xlmr tutorial notebook just as it showed.

Relevant Code

from pytext import workflow
from pytorch.text.fb.utils import PATH_MANAGER as PathManager  # noqa ( in file_io.py)

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