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

Which version of Keras, Tensorflow and Pytorch are compatible? #54

Open asr-lord opened 3 years ago

asr-lord commented 3 years ago

I'm using Google Colab to run this code over CPU and GPU but it doesn't work when I'm trying to run it.

My libraries version:

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

Error message:

python speakerDiarization.py

2021-06-25 12:23:18.495455: 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 11, in <module>
    import model as spkModel
  File "ghostvlad/model.py", line 28, in <module>
    class VladPooling(keras.engine.Layer):
AttributeError: module 'keras.engine' has no attribute 'Layer'

I tried with older versions of Tensorflow and Keras:

tensorflow==2.1
Keras==2.3.1

but I still getting errors:

Using TensorFlow backend.
2021-06-25 12:29:00.291956: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'libnvinfer.so.6'; dlerror: libnvinfer.so.6: cannot open shared object file: No such file or directory; LD_LIBRARY_PATH: /usr/lib64-nvidia
2021-06-25 12:29:00.292135: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'libnvinfer_plugin.so.6'; dlerror: libnvinfer_plugin.so.6: cannot open shared object file: No such file or directory; LD_LIBRARY_PATH: /usr/lib64-nvidia
2021-06-25 12:29:00.292155: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:30] Cannot dlopen some TensorRT libraries. If you would like to use Nvidia GPU with TensorRT, please make sure the missing libraries mentioned above are installed properly.
Traceback (most recent call last):
  File "speakerDiarization.py", line 11, in <module>
    import model as spkModel
  File "ghostvlad/model.py", line 3, 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__'
taylorlu commented 3 years ago

tensorflow 1.8-1.15 and pytorch 1.3.0 may work.

Grolaf commented 2 years ago

Hey there !

I installed tensorflow 1.15 and pytorch 1.3.0 but the keras version required by the code is missig, since the last keras version require tensorflow 2.2.0....

Which version of keras do we need ?

Thanks for all !

taylorlu commented 2 years ago

You can take a look at this page https://docs.floydhub.com/guides/environments

asr-lord commented 2 years ago

I have tried it but with no luck.

taylorlu commented 2 years ago

Tensorflow 1.8.0 Keras 2.2.4 pytorch 1.3.0

tanujdhiman commented 2 years ago

Tensorflow 1.8.0 Keras 2.2.4 pytorch 1.3.0

speak

ghost commented 2 years ago

Is this working with python 3.8.x? I'm using python 3.8 and couldn't find tensorflow 1.x version. Any updates would be helpful for Ubuntu 20.04, Python3.8 and tensorflow 2.x