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
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
/opt/conda/lib/python3.7/site-packages/transformers/utils/import_utils.py in _get_module(self, module_name)
/opt/conda/lib/python3.7/importlib/__init__.py in import_module(name, package)
126 level += 1
--> 127 return _bootstrap._gcd_import(name[level:], package, level)
128
/opt/conda/lib/python3.7/importlib/_bootstrap.py in _gcd_import(name, package, level)
/opt/conda/lib/python3.7/importlib/_bootstrap.py in _find_and_load(name, import_)
/opt/conda/lib/python3.7/importlib/_bootstrap.py in _find_and_load_unlocked(name, import_)
/opt/conda/lib/python3.7/importlib/_bootstrap.py in _load_unlocked(spec)
/opt/conda/lib/python3.7/importlib/_bootstrap_external.py in exec_module(self, module)
/opt/conda/lib/python3.7/importlib/_bootstrap.py in _call_with_frames_removed(f, *args, **kwds)
/opt/conda/lib/python3.7/site-packages/transformers/trainer.py in <module>
63 from .debug_utils import DebugOption, DebugUnderflowOverflow
---> 64 from .deepspeed import deepspeed_init, deepspeed_reinit, is_deepspeed_zero3_enabled
65 from .dependency_versions_check import dep_version_check
ImportError: cannot import name 'deepspeed_reinit' from 'transformers.deepspeed' (/opt/conda/lib/python3.7/site-packages/transformers/deepspeed.py)
The above exception was the direct cause of the following exception:
RuntimeError Traceback (most recent call last)
/tmp/ipykernel_27/1736218227.py in <module>
2 get_ipython().system('pip install transformers -q')
3 # import pysentimiento
----> 4 from pysentimiento import create_analyzer
5 # print(pysentimiento.__version__)
6 # analyzer = create_analyzer(task="sentiment", lang="en")
/opt/conda/lib/python3.7/site-packages/pysentimiento/__init__.py in <module>
1 from .metrics import compute_metrics
----> 2 from .analyzer import create_analyzer
/opt/conda/lib/python3.7/site-packages/pysentimiento/analyzer.py in <module>
1 import torch
2 from .preprocessing import preprocess_tweet
----> 3 from transformers import (
4 AutoTokenizer, AutoModelForSequenceClassification, AutoModelForTokenClassification,
5 DataCollatorWithPadding,
/opt/conda/lib/python3.7/importlib/_bootstrap.py in _handle_fromlist(module, fromlist, import_, recursive)
/opt/conda/lib/python3.7/site-packages/transformers/utils/import_utils.py in __getattr__(self, name)
/opt/conda/lib/python3.7/site-packages/transformers/utils/import_utils.py in _get_module(self, module_name)
RuntimeError: Failed to import transformers.trainer because of the following error (look up to see its traceback):
cannot import name 'deepspeed_reinit' from 'transformers.deepspeed' (/opt/conda/lib/python3.7/site-packages/transformers/deepspeed.py)
The text was updated successfully, but these errors were encountered:
Hi @maifeeulasad. It seems there is a problem in your environment between deepspeed and transformers. This does not seem to be related to this library.
BTW, try updating python to 3.8. You are also using a old version of the library.
Describe the bug
Gives error during import, saying:
RuntimeError: Failed to import transformers.trainer because of the following error
To Reproduce
Expected behavior
It should have been imported and worked.
Environment
Python:
3.7.12
pip freeze:
Additional context
Full stack-trace:
The text was updated successfully, but these errors were encountered: