MahmoudAshraf97 / whisper-diarization

Automatic Speech Recognition with Speaker Diarization based on OpenAI Whisper
BSD 2-Clause "Simplified" License
3.28k stars 272 forks source link

ValueError: mutable default <class 'hydra.conf.JobConf.JobConfig.OverrideDirname'> for field override_dirname is not allowed: use default_factory #65

Closed toriqxu closed 4 months ago

toriqxu commented 1 year ago

I've been able to run the code from a different machine but not from my own machine. When I try to run it on my own machine, I keep running into an error with hydra (pasted below). The only difference is that my machine is running a different version of pip and python.

Does anyone have insights on how to fix this error?

from nemo.collections.asr.models.msdd_models import NeuralDiarizer
  File "/opt/homebrew/lib/python3.11/site-packages/nemo/collections/asr/__init__.py", line 15, in <module>
    from nemo.collections.asr import data, losses, models, modules
  File "/opt/homebrew/lib/python3.11/site-packages/nemo/collections/asr/losses/__init__.py", line 15, in <module>
    from nemo.collections.asr.losses.angularloss import AngularSoftmaxLoss
  File "/opt/homebrew/lib/python3.11/site-packages/nemo/collections/asr/losses/angularloss.py", line 18, in <module>
    from nemo.core.classes import Loss, Typing, typecheck
  File "/opt/homebrew/lib/python3.11/site-packages/nemo/core/__init__.py", line 16, in <module>
    from nemo.core.classes import *
  File "/opt/homebrew/lib/python3.11/site-packages/nemo/core/classes/__init__.py", line 16, in <module>
    import hydra
  File "/opt/homebrew/lib/python3.11/site-packages/hydra/__init__.py", line 5, in <module>
    from hydra import utils
  File "/opt/homebrew/lib/python3.11/site-packages/hydra/utils.py", line 8, in <module>
    import hydra._internal.instantiate._instantiate2
  File "/opt/homebrew/lib/python3.11/site-packages/hydra/_internal/instantiate/_instantiate2.py", line 12, in <module>
    from hydra._internal.utils import _locate
  File "/opt/homebrew/lib/python3.11/site-packages/hydra/_internal/utils.py", line 18, in <module>
    from hydra.core.utils import get_valid_filename, validate_config_path
  File "/opt/homebrew/lib/python3.11/site-packages/hydra/core/utils.py", line 20, in <module>
    from hydra.core.hydra_config import HydraConfig
  File "/opt/homebrew/lib/python3.11/site-packages/hydra/core/hydra_config.py", line 6, in <module>
    from hydra.conf import HydraConf
  File "/opt/homebrew/lib/python3.11/site-packages/hydra/conf/__init__.py", line 46, in <module>
    class JobConf:
  File "/opt/homebrew/lib/python3.11/site-packages/hydra/conf/__init__.py", line 75, in JobConf
    @dataclass
     ^^^^^^^^^
  File "/opt/homebrew/Cellar/python@3.11/3.11.4_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/dataclasses.py", line 1230, in dataclass
    return wrap(cls)
           ^^^^^^^^^
  File "/opt/homebrew/Cellar/python@3.11/3.11.4_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/dataclasses.py", line 1220, in wrap
    return _process_class(cls, init, repr, eq, order, unsafe_hash,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/python@3.11/3.11.4_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/dataclasses.py", line 958, in _process_class
    cls_fields.append(_get_field(cls, name, type, kw_only))
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/python@3.11/3.11.4_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/dataclasses.py", line 815, in _get_field
    raise ValueError(f'mutable default {type(f.default)} for field '
ValueError: mutable default <class 'hydra.conf.JobConf.JobConfig.OverrideDirname'> for field override_dirname is not allowed: use default_factory
toriqxu commented 1 year ago

Yes, I resolved it! I think I had to re-install different versions of some required packages to get it to work. I have version 1.2.0 for hydra-core and version 1.17.0 for nemo-toolkit now. Let me know if you want me to send what versions I have for other packages.

MardanovaA commented 1 year ago

I found another issue recommending python 3.10 and deleted my comment. but now I see that it didn't solve the problem. Please send if you don't mind

toriqxu commented 1 year ago

It's really long, but here you go. You can probably ignore most of them, since they're not all related to the Whisper diarization.

absl-py                     1.4.0
aiobotocore                 2.5.2
aiohttp                     3.8.4
aioitertools                0.11.0
aiosignal                   1.3.1
alembic                     1.11.1
annotated-types             0.5.0
antlr4-python3-runtime      4.9.3
appdirs                     1.4.4
asteroid-filterbanks        0.4.0
asttokens                   2.2.1
async-timeout               4.0.2
attrs                       21.2.0
audioread                   3.0.0
Automat                     20.2.0
av                          10.0.0
Babel                       2.8.0
backcall                    0.2.0
backports.cached-property   1.0.2
bcrypt                      3.2.0
blinker                     1.4
boto3                       1.28.2
botocore                    1.29.161
braceexpand                 0.1.7
cachetools                  5.3.1
certifi                     2020.6.20
cffi                        1.15.1
chardet                     4.0.0
charset-normalizer          3.2.0
click                       8.1.4
cloud-init                  23.1.2
cloudpickle                 2.2.1
cmaes                       0.9.1
colorama                    0.4.4
coloredlogs                 15.0.1
colorlog                    6.7.0
comm                        0.1.3
command-not-found           0.3
configobj                   5.0.6
constantly                  15.1.0
contourpy                   1.1.0
cryptography                3.4.8
ctranslate2                 3.16.1
cycler                      0.11.0
Cython                      0.29.35
dbus-python                 1.2.18
debugpy                     1.6.7
decorator                   5.1.1
deepmultilingualpunctuation 1.0.1
demucs                      4.0.1a2
diffq                       0.2.4
Distance                    0.1.3
distro                      1.7.0
distro-info                 1.1build1
docker-pycreds              0.4.0
docopt                      0.6.2
dora-search                 0.1.12
ec2-hibinit-agent           1.0.0
editdistance                0.6.2
einops                      0.3.2
executing                   1.2.0
faster-whisper              0.5.1
ffmpeg-python               0.2.0
filelock                    3.12.2
flatbuffers                 23.5.26
fonttools                   4.40.0
frozenlist                  1.3.3
fsspec                      2023.6.0
future                      0.18.3
g2p-en                      2.1.0
gitdb                       4.0.10
GitPython                   3.1.32
google-api-core             2.11.1
google-api-python-client    2.92.0
google-auth                 2.21.0
google-auth-httplib2        0.1.0
google-auth-oauthlib        1.0.0
google-drive-api            0.0.4
googleapis-common-protos    1.59.1
greenlet                    2.0.2
grpcio                      1.56.0
hibagent                    1.0.1
hmmlearn                    0.2.8
httplib2                    0.20.2
huggingface-hub             0.16.4
humanfriendly               10.0
hydra-core                  1.2.0
hyperlink                   21.0.0
HyperPyYAML                 1.2.1
idna                        3.3
importlib-metadata          4.6.4
incremental                 21.3.0
inflect                     7.0.0
ipykernel                   6.24.0
ipython                     8.14.0
ipywidgets                  8.0.7
jedi                        0.18.2
jeepney                     0.7.1
Jinja2                      3.0.3
jiwer                       3.0.2
jmespath                    1.0.1
joblib                      1.3.1
jsonpatch                   1.32
jsonpointer                 2.0
jsonschema                  3.2.0
julius                      0.2.7
jupyter_client              8.3.0
jupyter_core                5.3.1
jupyterlab-widgets          3.0.8
kaldi-python-io             1.2.2
kaldiio                     2.18.0
keyring                     23.5.0
kiwisolver                  1.4.4
lameenc                     1.5.1
launchpadlib                1.10.16
lazr.restfulclient          0.14.4
lazr.uri                    1.0.6
Levenshtein                 0.21.1
librosa                     0.9.2
lightning-utilities         0.9.0
llvmlite                    0.40.1
loguru                      0.7.0
Mako                        1.2.4
Markdown                    3.4.3
markdown-it-py              3.0.0
MarkupSafe                  2.1.3
marshmallow                 3.19.0
matplotlib                  3.7.2
matplotlib-inline           0.1.6
mdurl                       0.1.2
more-itertools              8.10.0
mpmath                      1.3.0
multidict                   6.0.4
nemo-toolkit                1.17.0
nest-asyncio                1.5.6
netifaces                   0.11.0
networkx                    2.8.8
nltk                        3.8.1
numba                       0.57.1
numpy                       1.24.4
nvidia-cublas-cu11          11.10.3.66
nvidia-cuda-nvrtc-cu11      11.7.99
nvidia-cuda-runtime-cu11    11.7.99
nvidia-cudnn-cu11           8.5.0.96
oauth2client                4.1.3
oauthlib                    3.2.0
omegaconf                   2.2.3
onnx                        1.14.0
onnxruntime                 1.14.1
openunmix                   1.2.1
optuna                      3.2.0
packaging                   23.1
pandas                      2.0.3
parso                       0.8.3
pathtools                   0.1.2
pescador                    2.1.0
pexpect                     4.8.0
pickleshare                 0.7.5
Pillow                      10.0.0
pip                         23.1.2
plac                        1.3.5
platformdirs                3.8.1
pooch                       1.7.0
primePy                     1.3
prompt-toolkit              3.0.39
protobuf                    4.23.4
psutil                      5.9.5
ptyprocess                  0.7.0
pure-eval                   0.2.2
pyannote.audio              1.1.2
pyannote.core               4.5
pyannote.database           4.1.3
pyannote.metrics            3.2.1
pyannote.pipeline           1.5.2
pyasn1                      0.4.8
pyasn1-modules              0.2.1
pybind11                    2.10.4
pycparser                   2.21
pydantic                    2.0.2
pydantic_core               2.1.2
pyDeprecate                 0.3.2
pydub                       0.25.1
Pygments                    2.15.1
PyGObject                   3.42.1
PyHamcrest                  2.0.2
PyJWT                       2.3.0
pyOpenSSL                   21.0.0
pyparsing                   2.4.7
pyrsistent                  0.18.1
pyserial                    3.5
python-apt                  2.4.0+ubuntu1
python-dateutil             2.8.2
python-debian               0.1.43ubuntu1
python-magic                0.4.24
pytorch-lightning           1.9.4
pytorch-metric-learning     1.7.3
pytz                        2022.1
PyYAML                      5.4.1
pyzmq                       25.1.0
rapidfuzz                   2.13.7
regex                       2023.6.3
requests                    2.25.1
requests-oauthlib           1.3.1
resampy                     0.4.2
retrying                    1.3.4
rich                        13.4.2
rsa                         4.9
ruamel.yaml                 0.17.28
ruamel.yaml.clib            0.2.7
s3fs                        2023.6.0
s3transfer                  0.6.1
sacremoses                  0.0.53
safetensors                 0.3.1
scikit-learn                1.3.0
scipy                       1.11.1
SecretStorage               3.3.1
semver                      2.13.0
sentencepiece               0.1.99
sentry-sdk                  1.28.0
service-identity            18.1.0
setproctitle                1.3.2
setuptools                  65.5.1
shellingham                 1.5.0.post1
simplejson                  3.19.1
singledispatchmethod        1.0
six                         1.16.0
smmap                       5.0.0
sortedcollections           2.1.0
sortedcontainers            2.4.0
sos                         4.4
SoundFile                   0.10.3.post1
sox                         1.4.1
speechbrain                 0.5.14
SQLAlchemy                  2.0.18
ssh-import-id               5.11
stack-data                  0.6.2
submitit                    1.4.5
sympy                       1.12
systemd-python              234
tabulate                    0.9.0
tensorboard                 2.13.0
tensorboard-data-server     0.7.1
termcolor                   2.3.0
text-unidecode              1.3
texterrors                  0.4.4
threadpoolctl               3.1.0
tokenizers                  0.13.3
torch                       1.13.1
torch-audiomentations       0.11.0
torch-pitch-shift           1.2.4
torchaudio                  0.13.1
torchmetrics                0.11.4
tornado                     6.3.2
tqdm                        4.65.0
traitlets                   5.9.0
transformers                4.30.2
treetable                   0.2.5
Twisted                     22.1.0
typer                       0.9.0
typing_extensions           4.7.1
tzdata                      2023.3
ubuntu-advantage-tools      8001
ufw                         0.36.1
unattended-upgrades         0.1
uritemplate                 4.1.1
urllib3                     1.26.16
wadllib                     1.3.6
wandb                       0.15.5
wcwidth                     0.2.6
webdataset                  0.1.62
Werkzeug                    2.3.6
wget                        3.2
wheel                       0.40.0
whisperx                    1.0
widgetsnbextension          4.0.8
wrapt                       1.15.0
yarl                        1.9.2
youtokentome                1.0.6
zipp                        1.0.0
zope.interface              5.4.0
MardanovaA commented 1 year ago

Thank you so match! I will try it

MardanovaA commented 1 year ago

I checked packages versions and they are same as your. BUT I have resolve this error by using Python3.8 instead Python3.10 or Python3.11. And i cloned repository again and start over. It helps me!

FlynnHillier commented 1 year ago

I checked packages versions and they are same as your. BUT I have resolve this error by using Python3.8 instead Python3.10 or Python3.11. And i cloned repository again and start over. It helps me!

I am having the same issue, using python 3.11.4 ; I don't quite know which one of the versions you mentioned, is the one that seemed to resolve the issue for you. Could you please re-clarify ? Thanks. would be much appreciated.

emlazzarin commented 1 year ago

I had the same issue with Python 3.11.4. Downgrading to Python 3.8.17 and making sure to use the Cython <3.0.0 workaround (below; due to some issues upstream with pyyaml) resolved this.

pip install "cython<3.0.0" wheel && pip install pyyaml==5.4.1 --no-build-isolation
egeres commented 3 weeks ago

Same issue here with python 3.11.9