Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using Deepmatcher 0.1.2 in Kaggle - torchtext.legacy issue #85

Open
paulindani opened this issue Jun 12, 2021 · 4 comments
Open

Using Deepmatcher 0.1.2 in Kaggle - torchtext.legacy issue #85

paulindani opened this issue Jun 12, 2021 · 4 comments

Comments

@paulindani
Copy link

paulindani commented Jun 12, 2021

Using Deepmatcher 0.1.2 in Kaggle - torchtext.legacy issue

I have tried to use Deepmatcher 0.1.2 in Kaggle.com. I have tried both
!pip install -qqq deepmatcher==0.1.2
and
!pip install -qqq deepmatcher
Once the installation is done, when I try to import the package with
import deepmatcher as dm
the following error appears:


ModuleNotFoundError Traceback (most recent call last)
in
----> 1 import deepmatcher as dm

/opt/conda/lib/python3.7/site-packages/deepmatcher/init.py in
8 import sys
9
---> 10 from .data import process as data_process
11 from .models import modules
12 from .models.core import (MatchingModel, AttrSummarizer, WordContextualizer,

/opt/conda/lib/python3.7/site-packages/deepmatcher/data/init.py in
----> 1 from .field import MatchingField, reset_vector_cache
2 from .dataset import MatchingDataset
3 from .iterator import MatchingIterator
4 from .process import process, process_unlabeled
5 from .dataset import split

/opt/conda/lib/python3.7/site-packages/deepmatcher/data/field.py in
11 import fasttext
12 import torch
---> 13 from torchtext.legacy import data, vocab
14 from torchtext.utils import download_from_url
15 from urllib.request import urlretrieve

ModuleNotFoundError: No module named 'torchtext.legacy'

By default, torchtext version 0.8.0a0+cd6902d is installed in Kaggle.
This version of torchtext has the following sub packages:
dir(tochtext)
['all',
'builtins',
'cached',
'doc',
'file',
'loader',
'name',
'package',
'path',
'spec',
'version',
'data',
'datasets',
'git_version',
'nn',
'utils',
'version',
'vocab']

So there is no torchtext.legacy. I also could not find any version of torchtext where both data and vocab were in torchtext.legacy. So there may be a bug in deepmatcher 0.1.2 related to torchtext.legacy.

When I install deepmatcher 0.1.1 with
!pip install -qqq deepmatcher==0.1.1
everything is working fine.
I have tested some examples both on CPU and GPU and there are no issues.

@sidharthms
Copy link
Collaborator

This happens when your installed version of torchtext is out of date - deepmatcher requires torchtext 0.9 due to certain backwards incompatible changes made in 0.9. I'll update the pip required version in setup.py.

@adcoh
Copy link

adcoh commented Jun 2, 2022

@sidharthms also experiencing this issue. Checked the torchtext release notes and it's been removed as of v.0.12.0.

@rafaelbo
Copy link

I also have this issue, and I have torchtext v0.12.0. I saw on stackoverflow that it was supposed to work with torchtext v0.10.0 but this version isn't available on pip anymore.

ERROR: Could not find a version that satisfies the requirement torchtext==0.10.0 (from versions: 0.1.1, 0.2.0, 0.2.1, 0.2.3, 0.3.1, 0.4.0, 0.5.0, 0.6.0, 0.12.0)
ERROR: No matching distribution found for torchtext==0.10.0

@sidharthms
Copy link
Collaborator

sidharthms commented Jun 11, 2022 via email

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

No branches or pull requests

4 participants