taylorlu / Speaker-Diarization

speaker diarization by uis-rnn and speaker embedding by vgg-speaker-recognition
Apache License 2.0
455 stars 124 forks source link

Added missing dependencies. Updated tensorflow imports. #19

Closed chrisspen closed 2 years ago

chrisspen commented 4 years ago

Hi, thanks for providing this project. While trying to run the python speakerDiarization.py command in the README, I found there were several dependencies missing from the requirements.txt, so I've added them here. Since I don't know what versions this was originally written for, I used the most recent.

I suspect you originally used tensorflow<2, so I also updated a few imports to use the new tensorflow 2.

taylorlu commented 4 years ago

Yes, the tensorflow version I used was 1.14, thanks to point it out.

asr-lord commented 3 years ago

@chrisspen I'm trying to use your branch in Google Colab but I get the following error:

$ python speakerDiarization.py

2021-06-25 12:32:53.467256: I tensorflow/stream_executor/platform/default/dso_loader.cc:53] Successfully opened dynamic library libcudart.so.11.0
Traceback (most recent call last):
  File "speakerDiarization.py", line 16, in <module>
    from ghostvlad import model as spkModel
  File "/content/Speaker-Diarization/ghostvlad/model.py", line 30, in <module>
    class VladPooling(keras.engine.Layer):
AttributeError: module 'keras.engine' has no attribute 'Layer'

My Python libraries version:

Keras==2.4.3
tensorflow==2.5.0
torch==1.9.0+cu102

If I change it to:

torch==0.4.1
Keras==2.3.1
tensorflow==2.0.0
PyAudio==0.2.11
$ python speakerDiarization.py

Using TensorFlow backend.
Traceback (most recent call last):
  File "speakerDiarization.py", line 16, in <module>
    from ghostvlad import model as spkModel
  File "/content/Speaker-Diarization/ghostvlad/model.py", line 4, in <module>
    import keras
  File "/usr/local/lib/python3.7/dist-packages/keras/__init__.py", line 3, in <module>
    from . import utils
  File "/usr/local/lib/python3.7/dist-packages/keras/utils/__init__.py", line 26, in <module>
    from .vis_utils import model_to_dot
  File "/usr/local/lib/python3.7/dist-packages/keras/utils/vis_utils.py", line 7, in <module>
    from ..models import Model
  File "/usr/local/lib/python3.7/dist-packages/keras/models.py", line 10, in <module>
    from .engine.input_layer import Input
  File "/usr/local/lib/python3.7/dist-packages/keras/engine/__init__.py", line 3, in <module>
    from .input_layer import Input
  File "/usr/local/lib/python3.7/dist-packages/keras/engine/input_layer.py", line 7, in <module>
    from .base_layer import Layer
  File "/usr/local/lib/python3.7/dist-packages/keras/engine/base_layer.py", line 12, in <module>
    from .. import initializers
  File "/usr/local/lib/python3.7/dist-packages/keras/initializers/__init__.py", line 124, in <module>
    populate_deserializable_objects()
  File "/usr/local/lib/python3.7/dist-packages/keras/initializers/__init__.py", line 49, in populate_deserializable_objects
    LOCAL.GENERATED_WITH_V2 = tf.__internal__.tf2.enabled()
AttributeError: module 'tensorflow_core.compat.v2' has no attribute '__internal__'
RezaBi commented 2 years ago

@chrisspen I'm trying to use your branch in Google Colab but I get the following error:

$ python speakerDiarization.py

2021-06-25 12:32:53.467256: I tensorflow/stream_executor/platform/default/dso_loader.cc:53] Successfully opened dynamic library libcudart.so.11.0
Traceback (most recent call last):
  File "speakerDiarization.py", line 16, in <module>
    from ghostvlad import model as spkModel
  File "/content/Speaker-Diarization/ghostvlad/model.py", line 30, in <module>
    class VladPooling(keras.engine.Layer):
AttributeError: module 'keras.engine' has no attribute 'Layer'

My Python libraries version:

Keras==2.4.3
tensorflow==2.5.0
torch==1.9.0+cu102

If I change it to:

torch==0.4.1
Keras==2.3.1
tensorflow==2.0.0
PyAudio==0.2.11
$ python speakerDiarization.py

Using TensorFlow backend.
Traceback (most recent call last):
  File "speakerDiarization.py", line 16, in <module>
    from ghostvlad import model as spkModel
  File "/content/Speaker-Diarization/ghostvlad/model.py", line 4, in <module>
    import keras
  File "/usr/local/lib/python3.7/dist-packages/keras/__init__.py", line 3, in <module>
    from . import utils
  File "/usr/local/lib/python3.7/dist-packages/keras/utils/__init__.py", line 26, in <module>
    from .vis_utils import model_to_dot
  File "/usr/local/lib/python3.7/dist-packages/keras/utils/vis_utils.py", line 7, in <module>
    from ..models import Model
  File "/usr/local/lib/python3.7/dist-packages/keras/models.py", line 10, in <module>
    from .engine.input_layer import Input
  File "/usr/local/lib/python3.7/dist-packages/keras/engine/__init__.py", line 3, in <module>
    from .input_layer import Input
  File "/usr/local/lib/python3.7/dist-packages/keras/engine/input_layer.py", line 7, in <module>
    from .base_layer import Layer
  File "/usr/local/lib/python3.7/dist-packages/keras/engine/base_layer.py", line 12, in <module>
    from .. import initializers
  File "/usr/local/lib/python3.7/dist-packages/keras/initializers/__init__.py", line 124, in <module>
    populate_deserializable_objects()
  File "/usr/local/lib/python3.7/dist-packages/keras/initializers/__init__.py", line 49, in populate_deserializable_objects
    LOCAL.GENERATED_WITH_V2 = tf.__internal__.tf2.enabled()
AttributeError: module 'tensorflow_core.compat.v2' has no attribute '__internal__'

Hi, could you come up with a soloution for this. I came across the same issue!

chrisspen commented 2 years ago

This project doesn't work, even with the correct libraries, and it seems to be abandoned. I wouldn't waste your time trying to use it.