clarinsi / Slovene_ASR_e2e

Automatic Speech Recognition tool
Apache License 2.0
16 stars 2 forks source link

Error when launching on docker #6

Open SninaH opened 3 months ago

SninaH commented 3 months ago

When launching the nemo model in docker I get errors. This issue was not present in the pull request. The problem is probably in the pydantic version as the docker file in the pull request had a row RUN python3 -m pip install pydantic==1.8.2

The error I got when launching the transcriber server in docker:

transcriber-1  | [NeMo W 2024-05-15 15:02:15 optimizers:77] Could not import distributed_fused_adam optimizer from Apex
transcriber-1  | [NeMo D 2024-05-15 15:02:17 common:489] Model instantiation failed!
transcriber-1  |    Target class:   nemo.collections.asr.models.ctc_bpe_models.EncDecCTCModelBPE
transcriber-1  |    Error(s):  cannot import name 'Annotated' from 'pydantic.typing' (/opt/conda/lib/python3.8/site-packages/pydantic/typing.py)
transcriber-1  |    Traceback (most recent call last):
transcriber-1  |    File "/opt/conda/lib/python3.8/site-packages/nemo/core/classes/common.py", line 475, in from_config_dict
transcriber-1  |        imported_cls = import_class_by_path(target_cls)
transcriber-1  |    File "/opt/conda/lib/python3.8/site-packages/nemo/utils/model_utils.py", line 471, in import_class_by_path
transcriber-1  |        mod = __import__(path, fromlist=[class_name])
transcriber-1  |    File "/opt/conda/lib/python3.8/site-packages/nemo/collections/asr/__init__.py", line 15, in <module>
transcriber-1  |        from nemo.collections.asr import data, losses, models, modules
transcriber-1  |    File "/opt/conda/lib/python3.8/site-packages/nemo/collections/asr/models/__init__.py", line 16, in <module>
transcriber-1  |        from nemo.collections.asr.models.classification_models import EncDecClassificationModel
transcriber-1  |    File "/opt/conda/lib/python3.8/site-packages/nemo/collections/asr/models/classification_models.py", line 28, in <module>
transcriber-1  |        from nemo.collections.asr.data import audio_to_label_dataset
transcriber-1  |    File "/opt/conda/lib/python3.8/site-packages/nemo/collections/asr/data/audio_to_label_dataset.py", line 15, in <module>
transcriber-1  |        from nemo.collections.asr.data import audio_to_label
transcriber-1  |    File "/opt/conda/lib/python3.8/site-packages/nemo/collections/asr/data/audio_to_label.py", line 22, in <module>
transcriber-1  |        from nemo.collections.asr.data.audio_to_text import expand_audio_filepaths
transcriber-1  |    File "/opt/conda/lib/python3.8/site-packages/nemo/collections/asr/data/audio_to_text.py", line 25, in <module>
transcriber-1  |        from nemo.collections.asr.parts.preprocessing.features import WaveformFeaturizer
transcriber-1  |    File "/opt/conda/lib/python3.8/site-packages/nemo/collections/asr/parts/preprocessing/__init__.py", line 16, in <module>
transcriber-1  |        from nemo.collections.asr.parts.preprocessing.features import FeaturizerFactory, FilterbankFeatures, WaveformFeaturizer
transcriber-1  |    File "/opt/conda/lib/python3.8/site-packages/nemo/collections/asr/parts/preprocessing/features.py", line 43, in <module>
transcriber-1  |        from nemo.collections.asr.parts.preprocessing.perturb import AudioAugmentor
transcriber-1  |    File "/opt/conda/lib/python3.8/site-packages/nemo/collections/asr/parts/preprocessing/perturb.py", line 50, in <module>
transcriber-1  |        from nemo.collections.common.parts.preprocessing import collections, parsers
transcriber-1  |    File "/opt/conda/lib/python3.8/site-packages/nemo/collections/common/parts/preprocessing/collections.py", line 24, in <module>
transcriber-1  |        from nemo.collections.common.parts.preprocessing import manifest, parsers
transcriber-1  |    File "/opt/conda/lib/python3.8/site-packages/nemo/collections/common/parts/preprocessing/parsers.py", line 25, in <module>
transcriber-1  |        from nemo.collections.common.parts.preprocessing import cleaners
transcriber-1  |    File "/opt/conda/lib/python3.8/site-packages/nemo/collections/common/parts/preprocessing/cleaners.py", line 17, in <module>
transcriber-1  |        import inflect
transcriber-1  |    File "/opt/conda/lib/python3.8/site-packages/inflect/__init__.py", line 73, in <module>
transcriber-1  |        from pydantic.typing import Annotated
transcriber-1  |    ImportError: cannot import name 'Annotated' from 'pydantic.typing' (/opt/conda/lib/python3.8/site-packages/pydantic/typing.py)
transcriber-1  |     
transcriber-1  |    Falling back to `cls`.
transcriber-1  | [NeMo E 2024-05-15 15:02:17 common:503] Model instantiation failed!
transcriber-1  |    Target class:   nemo.collections.asr.models.ctc_bpe_models.EncDecCTCModelBPE
transcriber-1  |    Error(s):  cannot import name 'Annotated' from 'pydantic.typing' (/opt/conda/lib/python3.8/site-packages/pydantic/typing.py)
transcriber-1  |    Traceback (most recent call last):
transcriber-1  |    File "/opt/conda/lib/python3.8/site-packages/nemo/core/classes/common.py", line 475, in from_config_dict
transcriber-1  |        imported_cls = import_class_by_path(target_cls)
transcriber-1  |    File "/opt/conda/lib/python3.8/site-packages/nemo/utils/model_utils.py", line 471, in import_class_by_path
transcriber-1  |        mod = __import__(path, fromlist=[class_name])
transcriber-1  |    File "/opt/conda/lib/python3.8/site-packages/nemo/collections/asr/__init__.py", line 15, in <module>
transcriber-1  |        from nemo.collections.asr import data, losses, models, modules
transcriber-1  |    File "/opt/conda/lib/python3.8/site-packages/nemo/collections/asr/models/__init__.py", line 16, in <module>
transcriber-1  |        from nemo.collections.asr.models.classification_models import EncDecClassificationModel
transcriber-1  |    File "/opt/conda/lib/python3.8/site-packages/nemo/collections/asr/models/classification_models.py", line 28, in <module>
transcriber-1  |        from nemo.collections.asr.data import audio_to_label_dataset
transcriber-1  |    File "/opt/conda/lib/python3.8/site-packages/nemo/collections/asr/data/audio_to_label_dataset.py", line 15, in <module>
transcriber-1  |        from nemo.collections.asr.data import audio_to_label
transcriber-1  |    File "/opt/conda/lib/python3.8/site-packages/nemo/collections/asr/data/audio_to_label.py", line 22, in <module>
transcriber-1  |        from nemo.collections.asr.data.audio_to_text import expand_audio_filepaths
transcriber-1  |    File "/opt/conda/lib/python3.8/site-packages/nemo/collections/asr/data/audio_to_text.py", line 25, in <module>
transcriber-1  |        from nemo.collections.asr.parts.preprocessing.features import WaveformFeaturizer
transcriber-1  |    File "/opt/conda/lib/python3.8/site-packages/nemo/collections/asr/parts/preprocessing/__init__.py", line 16, in <module>
transcriber-1  |        from nemo.collections.asr.parts.preprocessing.features import FeaturizerFactory, FilterbankFeatures, WaveformFeaturizer
transcriber-1  |    File "/opt/conda/lib/python3.8/site-packages/nemo/collections/asr/parts/preprocessing/features.py", line 43, in <module>
transcriber-1  |        from nemo.collections.asr.parts.preprocessing.perturb import AudioAugmentor
transcriber-1  |    File "/opt/conda/lib/python3.8/site-packages/nemo/collections/asr/parts/preprocessing/perturb.py", line 50, in <module>
transcriber-1  |        from nemo.collections.common.parts.preprocessing import collections, parsers
transcriber-1  |    File "/opt/conda/lib/python3.8/site-packages/nemo/collections/common/parts/preprocessing/collections.py", line 24, in <module>
transcriber-1  |        from nemo.collections.common.parts.preprocessing import manifest, parsers
transcriber-1  |    File "/opt/conda/lib/python3.8/site-packages/nemo/collections/common/parts/preprocessing/parsers.py", line 25, in <module>
transcriber-1  |        from nemo.collections.common.parts.preprocessing import cleaners
transcriber-1  |    File "/opt/conda/lib/python3.8/site-packages/nemo/collections/common/parts/preprocessing/cleaners.py", line 17, in <module>
transcriber-1  |        import inflect
transcriber-1  |    File "/opt/conda/lib/python3.8/site-packages/inflect/__init__.py", line 73, in <module>
transcriber-1  |        from pydantic.typing import Annotated
transcriber-1  |    ImportError: cannot import name 'Annotated' from 'pydantic.typing' (/opt/conda/lib/python3.8/site-packages/pydantic/typing.py)
transcriber-1  |     
transcriber-1  | Traceback (most recent call last):
transcriber-1  |   File "server.py", line 268, in <module>
transcriber-1  |    start_time, models, num_requests_processed = initialize()
transcriber-1  |   File "server.py", line 245, in initialize
transcriber-1  |    model = ModelPT.restore_from(_model_path,map_location="cuda" if _model_platform == "gpu" else "cpu")
transcriber-1  |   File "/opt/conda/lib/python3.8/site-packages/nemo/core/classes/modelPT.py", line 311, in restore_from
transcriber-1  |    instance = cls._save_restore_connector.restore_from(
transcriber-1  |   File "/opt/conda/lib/python3.8/site-packages/nemo/core/connectors/save_restore_connector.py", line 235, in restore_from
transcriber-1  |    loaded_params = self.load_config_and_state_dict(
transcriber-1  |   File "/opt/conda/lib/python3.8/site-packages/nemo/core/connectors/save_restore_connector.py", line 158, in load_config_and_state_dict
transcriber-1  |    instance = calling_cls.from_config_dict(config=conf, trainer=trainer)
transcriber-1  |   File "/opt/conda/lib/python3.8/site-packages/nemo/core/classes/common.py", line 504, in from_config_dict
transcriber-1  |    raise e
transcriber-1  |   File "/opt/conda/lib/python3.8/site-packages/nemo/core/classes/common.py", line 496, in from_config_dict
transcriber-1  |    instance = cls(cfg=config, trainer=trainer)
transcriber-1  | TypeError: Can't instantiate abstract class ModelPT with abstract methods list_available_models, setup_training_data, setup_validation_data
transcriber-1 exited with code 0
SninaH commented 1 day ago

Hello, i simply used the pull request one. It works on linux, had some issues installing it on windows.

On Wed, 27 Nov 2024 at 14:39 MaticDiba @.***> wrote:

Hi, did you manage to solve this issue? I'm getting the same when trying to spin up this solution using docker compose.

— Reply to this email directly, view it on GitHub https://github.com/clarinsi/Slovene_ASR_e2e/issues/6#issuecomment-2503905058, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMEEGCWJFOPLCXKU4ETEORD2CXDSNAVCNFSM6AAAAABMKYGJ6GVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKMBTHEYDKMBVHA . You are receiving this because you authored the thread.Message ID: @.***>