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

tnpp_parse fails with import error #39

Open
harrikoo opened this issue Nov 15, 2022 · 1 comment
Open

tnpp_parse fails with import error #39

harrikoo opened this issue Nov 15, 2022 · 1 comment

Comments

@harrikoo
Copy link

When I install the parser as instructed on basic documentation and try to run the fir st example,

echo "Minulla on koira." | python3 tnpp_parse.py --conf models_fi_tdt_dia/pipelines.yaml parse_plaintext

tnpp_parse.py crashes with message:

Traceback (most recent call last):
  File "tnpp_parse.py", line 68, in <module>
    p=Pipeline(steps=pipeline, extra_args=args)
  File "[...]/Turku-neural-parser-pipeline/tnparser/pipeline.py", line 35, in __init__
    self.add_step(mod_name_and_params, extra_args)
  File "[...]/Turku-neural-parser-pipeline/tnparser/pipeline.py", line 84, in add_step
    mod=importlib.import_module("tnparser."+module_name)
  File "/usr/lib/python3.8/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 848, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "[...]/Turku-neural-parser-pipeline/tnparser/lightning_tagger_mod.py", line 3, in <module>
    import pytorch_lightning as pl
  File "[...]/Turku-neural-parser-pipeline/venv-tnpp/lib/python3.8/site-packages/pytorch_lightning/__init__.py", line 20, in <module>
    from pytorch_lightning import metrics  # noqa: E402
  File "[...]/Turku-neural-parser-pipeline/venv-tnpp/lib/python3.8/site-packages/pytorch_lightning/metrics/__init__.py", line 15, in <module>
    from pytorch_lightning.metrics.classification import (  # noqa: F401
  File "[...]/Turku-neural-parser-pipeline/venv-tnpp/lib/python3.8/site-packages/pytorch_lightning/metrics/classification/__init__.py", line 14, in <module>
    from pytorch_lightning.metrics.classification.accuracy import Accuracy  # noqa: F401
  File "[...]/Turku-neural-parser-pipeline/venv-tnpp/lib/python3.8/site-packages/pytorch_lightning/metrics/classification/accuracy.py", line 18, in <module>
    from pytorch_lightning.metrics.utils import deprecated_metrics, void
  File "[...]/Turku-neural-parser-pipeline/venv-tnpp/lib/python3.8/site-packages/pytorch_lightning/metrics/utils.py", line 22, in <module>
    from torchmetrics.utilities.data import get_num_classes as _get_num_classes
ImportError: cannot import name 'get_num_classes' from 'torchmetrics.utilities.data' ([...]/Turku-neural-parser-pipeline/venv-tnpp/lib/python3.8/site-packages/torchmetrics/utilities/data.py)
```
@haamis
Copy link

haamis commented Feb 9, 2023

Check out issue #41.

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

2 participants