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

Demo - DLL Load Failed, Toolbox - QT issue #260

Closed
ChellyCoco opened this issue Jan 5, 2020 · 10 comments
Closed

Demo - DLL Load Failed, Toolbox - QT issue #260

ChellyCoco opened this issue Jan 5, 2020 · 10 comments

Comments

@ChellyCoco
Copy link

Hello! I've managed to iron out most problems, but here's what I'm currently stuck with!

All requirements installed, Win 10, Python 3.7, Cuda 10 (but tried 8 and 9 too with relevant CuDNN)

Pip list

absl-py              0.9.0
astor                0.8.1
audioread            2.1.8
cachetools           4.0.0
certifi              2019.11.28
cffi                 1.13.2
chardet              3.0.4
cycler               0.10.0
decorator            4.4.1
dill                 0.3.1.1
gast                 0.2.2
gitdb2               2.0.6
GitPython            3.0.5
google-auth          1.10.0
google-auth-oauthlib 0.4.1
google-pasta         0.1.8
grpcio               1.26.0
h5py                 2.10.0
idna                 2.8
importlib-metadata   1.3.0
inflect              4.0.0
joblib               0.14.1
jsonpatch            1.24
jsonpointer          2.0
Keras-Applications   1.0.8
Keras-Preprocessing  1.1.0
kiwisolver           1.1.0
librosa              0.7.1
llvmlite             0.31.0
Markdown             3.1.1
matplotlib           3.1.2
mock                 3.0.5
more-itertools       8.0.2
multiprocess         0.70.9
numba                0.47.0
numpy                1.16.4
oauthlib             3.1.0
opt-einsum           3.1.0
Pillow               7.0.0
pip                  19.3.1
protobuf             3.11.2
pyasn1               0.4.8
pyasn1-modules       0.2.7
pycparser            2.19
pyparsing            2.4.6
PyQt5                5.12
PyQt5-sip            4.19.19
python-dateutil      2.8.1
pyzmq                18.1.1
requests             2.22.0
requests-oauthlib    1.3.0
resampy              0.2.2
rsa                  4.0
scikit-learn         0.22.1
scipy                1.4.1
setuptools           44.0.0
six                  1.13.0
smmap2               2.0.5
sounddevice          0.3.14
SoundFile            0.10.3.post1
tensorboard          1.13.1
tensorflow           1.13.1
tensorflow-estimator 1.13.0
tensorflow-gpu       1.13.1
termcolor            1.1.0
torch                1.2.0+cu92
torchfile            0.1.0
torchvision          0.4.0+cu92
tornado              6.0.3
tqdm                 4.41.1
umap-learn           0.3.10
Unidecode            1.1.1
urllib3              1.25.7
visdom               0.1.8.9
webrtcvad            2.0.10
websocket-client     0.57.0
Werkzeug             0.16.0
wheel                0.33.6
wrapt                1.11.2
zipp                 0.6.0

running demo_cli.py

Z:\Real-Time-Voice-Cloning>python demo_cli.py
Traceback (most recent call last):
  File "demo_cli.py", line 3, in <module>
    from synthesizer.inference import Synthesizer
  File "Z:\Real-Time-Voice-Cloning\synthesizer\inference.py", line 1, in <module>
    from synthesizer.tacotron2 import Tacotron2
  File "Z:\Real-Time-Voice-Cloning\synthesizer\tacotron2.py", line 5, in <module>
    from synthesizer import audio
  File "Z:\Real-Time-Voice-Cloning\synthesizer\audio.py", line 1, in <module>
    import librosa
  File "C:\Users\Chelly\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\librosa\__init__.py", line 12, in <module>
    from . import core
  File "C:\Users\Chelly\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\librosa\core\__init__.py", line 123, in <module>
    from .time_frequency import *  # pylint: disable=wildcard-import
  File "C:\Users\Chelly\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\librosa\core\time_frequency.py", line 11, in <module>
    from ..util.exceptions import ParameterError
  File "C:\Users\Chelly\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\librosa\util\__init__.py", line 81, in <module>
    from ._nnls import *  # pylint: disable=wildcard-import
  File "C:\Users\Chelly\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\librosa\util\_nnls.py", line 13, in <module>
    import scipy.optimize
  File "C:\Users\Chelly\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\scipy\optimize\__init__.py", line 389, in <module>
    from .optimize import *
  File "C:\Users\Chelly\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\scipy\optimize\optimize.py", line 37, in <module>
    from .linesearch import (line_search_wolfe1, line_search_wolfe2,
  File "C:\Users\Chelly\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\scipy\optimize\linesearch.py", line 18, in <module>
    from scipy.optimize import minpack2
ImportError: DLL load failed: The specified module could not be found.

running demo_toolbox.py

Z:\Real-Time-Voice-Cloning>python demo_toolbox.py
Traceback (most recent call last):
  File "demo_toolbox.py", line 2, in <module>
    from toolbox import Toolbox
  File "Z:\Real-Time-Voice-Cloning\toolbox\__init__.py", line 1, in <module>
    from toolbox.ui import UI
  File "Z:\Real-Time-Voice-Cloning\toolbox\ui.py", line 1, in <module>
    from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as FigureCanvas
  File "C:\Users\Chelly\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\matplotlib\backends\backend_qt5agg.py", line 11, in <module>
    from .backend_qt5 import (
  File "C:\Users\Chelly\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\matplotlib\backends\backend_qt5.py", line 15, in <module>
    import matplotlib.backends.qt_editor.figureoptions as figureoptions
  File "C:\Users\Chelly\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\matplotlib\backends\qt_editor\figureoptions.py", line 13, in <module>
    from matplotlib.backends.qt_compat import QtGui
  File "C:\Users\Chelly\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\matplotlib\backends\qt_compat.py", line 158, in <module>
    raise ImportError("Failed to import any qt binding")
ImportError: Failed to import any qt binding

Any insights in to this?

Many thanks!

@LordBaaa
Copy link

LordBaaa commented Jan 6, 2020

@ChellyTots Well for demo_cli.py I'd say try importing scipy in python console and see if it errors out. If it works keep going in the list, aka try scipy.optimize and finnally from scipy.optimize import minpack2 until it does.

For demo_toolbox.py I had the same problem, it took me a while but I realized that qt_compat.py was doing a check for a QT_API and it had none. To fix this I just ran pip install PyQt5. (pip3.7 in my case). It loaded up immediately after that. Hope this helps.

@LordBaaa
Copy link

@ChellyTots I usually forget to @ ppl so hopefully you'll see this.

@BostonCs1820
Copy link

@ChellyTots

I had the same issue and the PyQt5 didnt solve it either.

I dont know what in the end solved the problem but I deinstalled python and had to install Anaconda first.

Folllow this tutorial step by step he should cover all the problems.
[https://www.youtube.com/watch?v=pKoOw5a74XU]

@SamPeckCodes
Copy link

Hey @LordBaaa I did a pip list and i still cant import any qt binding.

I ran pip install PyQt5 and it says requirement already satisfied

File "C:\Users\Blah\AppData\Local\Programs\Python\Python37\lib\site-packages\matplotlib\backends\qt_compat.py", line 168, in
raise ImportError("Failed to import any qt binding")
ImportError: Failed to import any qt binding

@maxi07
Copy link

maxi07 commented Jul 2, 2020

I am struggeling with the same issue here :(

@ghost
Copy link

ghost commented Jul 4, 2020

Can you please pull the latest code from the repo, update to the current requirements.txt and try again? We have added CPU support and made changes which should make the setup easier. Reopen this issue if you continue to experience this issue with the latest code.

@ghost ghost closed this as completed Jul 4, 2020
@maxi07
Copy link

maxi07 commented Jul 7, 2020

Hi @blue-fish , the issue still resists with the current commit.
Running the test with python demo_cli.py results into

2020-07-07 15:57:44.912120: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'cudart64_100.dll'; dlerror: cudart64_100.dll not found
2020-07-07 15:57:44.918696: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine.
Traceback (most recent call last):
  File "demo_cli.py", line 3, in <module>
    from synthesizer.inference import Synthesizer
  File "C:\Users\max\Real-Time-Voice-Cloning\synthesizer\inference.py", line 1, in <module>
    from synthesizer.tacotron2 import Tacotron2
  File "C:\Users\max\Real-Time-Voice-Cloning\synthesizer\tacotron2.py", line 3, in <module>
    from synthesizer.models import create_model
  File "C:\Users\max\Real-Time-Voice-Cloning\synthesizer\models\__init__.py", line 1, in <module>
    from .tacotron import Tacotron
  File "C:\Users\max\Real-Time-Voice-Cloning\synthesizer\models\tacotron.py", line 1, in <module>
    import tensorflow as tf
  File "C:\Users\max\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\tensorflow\__init__.py", line 99, in <module>
    from tensorflow_core import *
  File "C:\Users\max\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\tensorflow_core\__init__.py", line 28, in <module>
    from tensorflow.python import pywrap_tensorflow  # pylint: disable=unused-import
  File "<frozen importlib._bootstrap>", line 1019, in _handle_fromlist
  File "C:\Users\max\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\tensorflow\__init__.py", line 50, in __getattr__
    module = self._load()
  File "C:\Users\max\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\tensorflow\__init__.py", line 44, in _load
    module = _importlib.import_module(self.__name__)
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.2288.0_x64__qbz5n2kfra8p0\lib\importlib\__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "C:\Users\max\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\tensorflow_core\python\__init__.py", line 83, in <module>
    from tensorflow.python import keras
  File "C:\Users\max\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\tensorflow_core\python\keras\__init__.py", line 26, in <module>
    from tensorflow.python.keras import activations
  File "C:\Users\max\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\tensorflow_core\python\keras\__init__.py", line 26, in <module>
    from tensorflow.python.keras import activations
  File "C:\Users\max\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\tensorflow_core\python\keras\activations.py", line 23, in <module>
    from tensorflow.python.keras.utils.generic_utils import deserialize_keras_object
  File "C:\Users\max\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\tensorflow_core\python\keras\utils\__init__.py", line 38, in <module>
    from tensorflow.python.keras.utils.multi_gpu_utils import multi_gpu_model
  File "C:\Users\max\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\tensorflow_core\python\keras\utils\multi_gpu_utils.py", line 22, in <module>
    from tensorflow.python.keras.engine.training import Model
  File "C:\Users\max\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\tensorflow_core\python\keras\engine\training.py", line 47, in <module>
    from tensorflow.python.keras.engine import training_arrays
  File "C:\Users\max\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\tensorflow_core\python\keras\engine\training_arrays.py", line 41, in <module>
    from scipy.sparse import issparse  # pylint: disable=g-import-not-at-top
  File "C:\Users\max\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\scipy\__init__.py", line 104, in <module>
    from . import _distributor_init
  File "C:\Users\max\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\scipy\_distributor_init.py", line 61, in <module>
    WinDLL(os.path.abspath(filename))
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.2288.0_x64__qbz5n2kfra8p0\lib\ctypes\__init__.py", line 364, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: [WinError 126] The module was not found.

And running the toolbox itself returns

Traceback (most recent call last):
  File "demo_toolbox.py", line 2, in <module>
    from toolbox import Toolbox
  File "C:\Users\max\Real-Time-Voice-Cloning\toolbox\__init__.py", line 1, in <module>
    from toolbox.ui import UI
  File "C:\Users\max\Real-Time-Voice-Cloning\toolbox\ui.py", line 1, in <module>
    from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as FigureCanvas
  File "C:\Users\max\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\matplotlib\backends\backend_qt5agg.py", line 11, in <module>
    from .backend_qt5 import (
  File "C:\Users\max\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\matplotlib\backends\backend_qt5.py", line 15, in <module>
    import matplotlib.backends.qt_editor.figureoptions as figureoptions
  File "C:\Users\max\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\matplotlib\backends\qt_editor\figureoptions.py", line 12, in <module>
    from matplotlib.backends.qt_compat import QtGui
  File "C:\Users\max\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\matplotlib\backends\qt_compat.py", line 168, in <module>
    raise ImportError("Failed to import any qt binding")
ImportError: Failed to import any qt binding

I tried manually installing PyQt5, but the requirement is already satisfied. The requirements are installed via pip install -r requirements.txt

@ghost ghost reopened this Jul 7, 2020
@ghost
Copy link

ghost commented Jul 7, 2020

Thanks for giving it another try @maxi07 . Doing a quick search it seems you may need to upgrade your pip to get a later version of matplotlib that is compatible with your PyQt5. Try this and see if the toolbox will work:

pip uninstall matplotlib
python -m pip install --upgrade pip
pip install matplotlib

@maxi07
Copy link

maxi07 commented Jul 7, 2020

Hi @blue-fish , I followed your steps but without success, as pip was already using the latest version 20.1.1.. After that I deinstalled Python (which was previously installed through the Microsoft Store) and upgraded to the latest 3.7.8, in hope this would resolve the issue. This actually changed the error message.

Running the testing script

2020-07-07 19:57:48.802524: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'cudart64_100.dll'; dlerror: cudart64_100.dll not found
2020-07-07 19:57:48.805869: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine.
Traceback (most recent call last):
  File "demo_cli.py", line 3, in <module>
    from synthesizer.inference import Synthesizer
  File "C:\Users\max\Real-Time-Voice-Cloning\synthesizer\inference.py", line 1, in <module>
    from synthesizer.tacotron2 import Tacotron2
  File "C:\Users\max\Real-Time-Voice-Cloning\synthesizer\tacotron2.py", line 3, in <module>
    from synthesizer.models import create_model
  File "C:\Users\max\Real-Time-Voice-Cloning\synthesizer\models\__init__.py", line 1, in <module>
    from .tacotron import Tacotron
  File "C:\Users\max\Real-Time-Voice-Cloning\synthesizer\models\tacotron.py", line 5, in <module>
    from synthesizer.models.modules import *
  File "C:\Users\max\Real-Time-Voice-Cloning\synthesizer\models\modules.py", line 2, in <module>
    import torch
  File "C:\Users\max\AppData\Local\Programs\Python\Python37\lib\site-packages\torch\__init__.py", line 81, in <module>
    from torch._C import *
ImportError: DLL load failed: The module was not found.

Running the actual toolbox:

Traceback (most recent call last):
  File "demo_toolbox.py", line 2, in <module>
    from toolbox import Toolbox
  File "C:\Users\max\Real-Time-Voice-Cloning\toolbox\__init__.py", line 1, in <module>
    from toolbox.ui import UI
  File "C:\Users\max\Real-Time-Voice-Cloning\toolbox\ui.py", line 5, in <module>
    from encoder.inference import plot_embedding_as_heatmap
  File "C:\Users\max\Real-Time-Voice-Cloning\encoder\inference.py", line 2, in <module>
    from encoder.model import SpeakerEncoder
  File "C:\Users\max\Real-Time-Voice-Cloning\encoder\model.py", line 5, in <module>
    from torch.nn.utils import clip_grad_norm_
  File "C:\Users\max\AppData\Local\Programs\Python\Python37\lib\site-packages\torch\__init__.py", line 81, in <module>
    from torch._C import *
ImportError: DLL load failed: The module was not found.

The solution

After some quick research I figured out, that I was using the wrong PyTorch version. I was following along your suggested setup guide from here, which had an install command for PyTorch. I headed over so the PyTorch site and downloaded the latest version with pip install torch==1.5.1+cpu torchvision==0.6.1+cpu -f https://download.pytorch.org/whl/torch_stable.html (as I don't have a GPU ready).

And this fixed it! The test script now runs, but your documentation in the Readme.md is missing the --cpu tag when running the script.

@ghost
Copy link

ghost commented Jul 7, 2020

Nice! Thank you for documenting your troubleshooting steps @maxi07 . I see you opened #405 to fix the documentation issue. I'll comment on that aspect in the pull request.

This issue was closed.
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

5 participants