CorentinJ / Real-Time-Voice-Cloning

Clone a voice in 5 seconds to generate arbitrary speech in real-time
Other
52.54k stars 8.79k forks source link

Tensorflow DLL error (what is the best combo to use of TF & Cuda/?) #245

Closed daddybird292 closed 4 years ago

daddybird292 commented 4 years ago

I've squashed so many errors and now I'm stuck on this one. Anyone have some advise of the exact version of TF to use along with Cuda and CuDNN?

Thanks a bunch!!!

(DeepvoiceC) C:\DeepvoiceC\Real-Time-Voice-Cloning>python demo_cli.py Traceback (most recent call last): File "C:\Users\bev\Anaconda3\envs\DeepvoiceC\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in from tensorflow.python.pywrap_tensorflow_internal import * File "C:\Users\bev\Anaconda3\envs\DeepvoiceC\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 28, in _pywrap_tensorflow_internal = swig_import_helper() File "C:\Users\bev\Anaconda3\envs\DeepvoiceC\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 24, in swig_import_helper _mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description) File "C:\Users\bev\Anaconda3\envs\DeepvoiceC\lib\imp.py", line 242, in load_module return load_dynamic(name, filename, file) File "C:\Users\bev\Anaconda3\envs\DeepvoiceC\lib\imp.py", line 342, in load_dynamic return _load(spec) ImportError: DLL load failed: A dynamic link library (DLL) initialization routine failed.

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "demo_cli.py", line 3, in from synthesizer.inference import Synthesizer File "C:\DeepvoiceC\Real-Time-Voice-Cloning\synthesizer\inference.py", line 1, in from synthesizer.tacotron2 import Tacotron2 File "C:\DeepvoiceC\Real-Time-Voice-Cloning\synthesizer\tacotron2.py", line 3, in from synthesizer.models import create_model File "C:\DeepvoiceC\Real-Time-Voice-Cloning\synthesizer\models__init.py", line 1, in from .tacotron import Tacotron File "C:\DeepvoiceC\Real-Time-Voice-Cloning\synthesizer\models\tacotron.py", line 1, in import tensorflow as tf File "C:\Users\bev\Anaconda3\envs\DeepvoiceC\lib\site-packages\tensorflow__init__.py", line 28, in from tensorflow.python import pywrap_tensorflow # pylint: disable=unused-import File "C:\Users\bev\Anaconda3\envs\DeepvoiceC\lib\site-packages\tensorflow\python\init__.py", line 49, in from tensorflow.python import pywrap_tensorflow File "C:\Users\bev\Anaconda3\envs\DeepvoiceC\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 74, in raise ImportError(msg) ImportError: Traceback (most recent call last): File "C:\Users\bev\Anaconda3\envs\DeepvoiceC\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in from tensorflow.python.pywrap_tensorflow_internal import * File "C:\Users\bev\Anaconda3\envs\DeepvoiceC\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 28, in _pywrap_tensorflow_internal = swig_import_helper() File "C:\Users\bev\Anaconda3\envs\DeepvoiceC\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 24, in swig_import_helper _mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description) File "C:\Users\bev\Anaconda3\envs\DeepvoiceC\lib\imp.py", line 242, in load_module return load_dynamic(name, filename, file) File "C:\Users\bev\Anaconda3\envs\DeepvoiceC\lib\imp.py", line 342, in load_dynamic return _load(spec) ImportError: DLL load failed: A dynamic link library (DLL) initialization routine failed.

Failed to load the native TensorFlow runtime.

See https://www.tensorflow.org/install/errors

zoldaten commented 4 years ago

ImportError: DLL load failed: A dynamic link library (DLL) initialization routine failed. Try to increase swap file. It works for me with 12 Gb of swap (to train a network). To start up examples above enough 1-3Gb. Cuda 10.2, Tensorflow-gpu==1.15.0, GeForce 1060 6Gb

daddybird292 commented 4 years ago

Thanks for the idea, really appreciate it. This swap file.... is that for Linux? I'm looking all over PyCharm for a swap file setting. The only thing which comes to mind is Windows virtual memory. I have 32gb on this system, but if it's not using it, that would make sense. I could make a Linux VM but I don't know if that would use the GPU or not.

zoldaten commented 4 years ago

I meant virtual memory - pagefile.sys for windows, swap for linux. I use Windows 7, 8 Gb RAM, 12Gb pagefile.sys When you start tensorflow it will use GPU automatically if needed. You can check that with GPU-Z utility.

daddybird292 commented 4 years ago

Ahhh drat.... that machine has 32gb of Virtual memory on it. I wonder if that's the error you get when the version of CuDNN, or TF or Cuda is not matched up just right.

daddybird292 commented 4 years ago

Are there any experts for hire which could remote into a system and make this program work?

SquallAlex commented 4 years ago

'conda activate deepvoice'-activate created virtual environment

For Cuda-CDNN-etc...

Update! There is no tedious process like this required now as anaconda is directly providing a command to install tensorflow-gpu. Just create a new environment using conda create -n [name] python=[version] And then use conda install -c conda-forge tensorflow-gpu and it will assess which version (CUDA,CUDNN, etc.) you require and download and install it directly ;)

pip install -r requirements.txt

conda install pytorch torchvision cudatoolkit=10.1 -c pytorch

conda install -c conda-forge tensorflow-gpu

Toolbox You can then try the toolbox:

python demo_toolbox.py -d H:\Deepvoice_Datasets <---- root of the databese folders no spapes between folders

python encoder_preprocess.py H:\Deepvoice_Datasets

or python demo_toolbox.py

daddybird292 commented 4 years ago

That was super cool, thank you SquallAlex

I was really hoping that would do it:

(DeepvoiceC2) C:\DeepvoiceC2\Real-Time-Voice-Cloning>python demo_cli.py Traceback (most recent call last): File "C:\Users\bev\Anaconda3\envs\DeepvoiceC2\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in from tensorflow.python.pywrap_tensorflow_internal import * File "C:\Users\bev\Anaconda3\envs\DeepvoiceC2\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 28, in _pywrap_tensorflow_internal = swig_import_helper() File "C:\Users\bev\Anaconda3\envs\DeepvoiceC2\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 24, in swig_import_helper _mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description) File "C:\Users\bev\Anaconda3\envs\DeepvoiceC2\lib\imp.py", line 242, in load_module return load_dynamic(name, filename, file) File "C:\Users\bev\Anaconda3\envs\DeepvoiceC2\lib\imp.py", line 342, in load_dynamic return _load(spec) ImportError: DLL load failed: A dynamic link library (DLL) initialization routine failed.

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "demo_cli.py", line 3, in from synthesizer.inference import Synthesizer File "C:\DeepvoiceC2\Real-Time-Voice-Cloning\synthesizer\inference.py", line 1, in from synthesizer.tacotron2 import Tacotron2 File "C:\DeepvoiceC2\Real-Time-Voice-Cloning\synthesizer\tacotron2.py", line 3, in from synthesizer.models import create_model File "C:\DeepvoiceC2\Real-Time-Voice-Cloning\synthesizer\models__init.py", line 1, in from .tacotron import Tacotron File "C:\DeepvoiceC2\Real-Time-Voice-Cloning\synthesizer\models\tacotron.py", line 1, in import tensorflow as tf File "C:\Users\bev\Anaconda3\envs\DeepvoiceC2\lib\site-packages\tensorflow__init__.py", line 28, in from tensorflow.python import pywrap_tensorflow # pylint: disable=unused-import File "C:\Users\bev\Anaconda3\envs\DeepvoiceC2\lib\site-packages\tensorflow\python\init__.py", line 49, in from tensorflow.python import pywrap_tensorflow File "C:\Users\bev\Anaconda3\envs\DeepvoiceC2\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 74, in raise ImportError(msg) ImportError: Traceback (most recent call last): File "C:\Users\bev\Anaconda3\envs\DeepvoiceC2\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in from tensorflow.python.pywrap_tensorflow_internal import * File "C:\Users\bev\Anaconda3\envs\DeepvoiceC2\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 28, in _pywrap_tensorflow_internal = swig_import_helper() File "C:\Users\bev\Anaconda3\envs\DeepvoiceC2\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 24, in swig_import_helper _mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description) File "C:\Users\bev\Anaconda3\envs\DeepvoiceC2\lib\imp.py", line 242, in load_module return load_dynamic(name, filename, file) File "C:\Users\bev\Anaconda3\envs\DeepvoiceC2\lib\imp.py", line 342, in load_dynamic return _load(spec) ImportError: DLL load failed: A dynamic link library (DLL) initialization routine failed.

Failed to load the native TensorFlow runtime.

See https://www.tensorflow.org/install/errors

SquallAlex commented 4 years ago

If you have a cuda gpu and still get this error after you run and install all cuda related dlls and stuff with: conda install -c conda-forge tensorflow-gpu I suggest you start in a new virtual env from scratch this command might install a newer version of tensorflow gpu (the requirements.txt has version 1.14.0) see what version you have after you run all commands and if you don't have 1.14.0 unninstall the version you have and run the requirements.txt command again to intsall 1.14.0

ghost commented 4 years ago

Can you please pull the latest code in the repo and try again? We currently require tensorflow 1.15 and the GPU is optional. Now that we have CPU support it is a lot easier to get the toolbox working.

I'm going to close this issue as it is stale. We haven't solved this particular problem but at least you won't have to make the tensorflow and CUDA versions line up.