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

ModuleError when running xlm_r_tutorial.ipynb #1704

Open
Litsay opened this issue Jul 9, 2021 · 1 comment
Open

ModuleError when running xlm_r_tutorial.ipynb #1704

Litsay opened this issue Jul 9, 2021 · 1 comment

Comments

@Litsay
Copy link

Litsay commented Jul 9, 2021

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)
@anjali-chadha
Copy link

@sy-LeeAP Did you find a fix for this issue?

I am having similar errors while importing pytext when installed from source: #1706

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants