You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ pip install trankit
$ python
Python 3.8.6 (default, Oct 21 2020, 08:28:24)
[Clang 11.0.0 (clang-1100.0.33.12)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from trankit import Pipeline
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "vtrankit/lib/python3.8/site-packages/trankit/__init__.py", line 1, in <module>
from .pipeline import Pipeline
File "vtrankit/lib/python3.8/site-packages/trankit/pipeline.py", line 2, in <module>
from .models.base_models import Multilingual_Embedding
File "vtrankit/lib/python3.8/site-packages/trankit/models/__init__.py", line 1, in <module>
from .classifiers import *
File "vtrankit/lib/python3.8/site-packages/trankit/models/classifiers.py", line 2, in <module>
from .base_models import *
File "vtrankit/lib/python3.8/site-packages/trankit/models/base_models.py", line 1, in <module>
from transformers import AdapterType, XLMRobertaModel
File "vtrankit/lib/python3.8/site-packages/transformers/__init__.py", line 672, in <module>
from .trainer import Trainer
File "vtrankit/lib/python3.8/site-packages/transformers/trainer.py", line 69, in <module>
from .trainer_pt_utils import (
File "vtrankit/lib/python3.8/site-packages/transformers/trainer_pt_utils.py", line 40, in <module>
from torch.optim.lr_scheduler import SAVE_STATE_WARNING
ImportError: cannot import name 'SAVE_STATE_WARNING' from 'torch.optim.lr_scheduler' (vtrankit/lib/python3.8/site-packages/torch/optim/lr_scheduler.py)
$ pip freeze
adapter-transformers==1.1.1
certifi==2020.12.5
chardet==4.0.0
click==7.1.2
filelock==3.0.12
idna==2.10
joblib==1.0.1
numpy==1.20.1
packaging==20.9
protobuf==3.15.5
pyparsing==2.4.7
regex==2020.11.13
requests==2.25.1
sacremoses==0.0.43
sentencepiece==0.1.91
six==1.15.0
tokenizers==0.9.3
torch==1.8.0
tqdm==4.58.0
trankit==0.3.5
typing-extensions==3.7.4.3
urllib3==1.26.3
I've been looking around, the same error happened here. Not sure what is happening, but seems like my pytorch version is too new? The setup.py for trankit specifies torch>=1.6.1.
The text was updated successfully, but these errors were encountered:
Resolved. Looks like it was an issue with the adapter-transformers library. The version 1.1.1 is broken with trankit but 1.0.1 is functional. You can force the version install with setup.py if others have this issue too.
Hi @kpister,
Thank you for letting us know.
You're right that the import error came from the version 1.1.1 of the adapter-transformers. We have specified the version 1.0.1 for the adapter-transformers for installing trankit. The new version of trankit that fixed this problem is 0.3.6.
Thanks.
I'm having some trouble installing
trankit
.Created a new
venv
on python 3.8I've been looking around, the same error happened here. Not sure what is happening, but seems like my pytorch version is too new? The
setup.py
fortrankit
specifiestorch>=1.6.1
.The text was updated successfully, but these errors were encountered: