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

OSError: [WinError 126] The specified module could not be found (Real-Time-Voice-Cloning-master) #407

Closed
pritxm opened this issue Jul 8, 2020 · 30 comments

Comments

@pritxm
Copy link

pritxm commented Jul 8, 2020

PS C:\Users\Pritam> cd D:\Game\Real-Time-Voice-Cloning-master
PS D:\Game\Real-Time-Voice-Cloning-master> python demo_cli.py
2020-07-08 12:18:00.259919: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cudart64_100.dll
Traceback (most recent call last):
File "demo_cli.py", line 3, in
from synthesizer.inference import Synthesizer
File "D:\Game\Real-Time-Voice-Cloning-master\synthesizer\inference.py", line 1, in
from synthesizer.tacotron2 import Tacotron2
File "D:\Game\Real-Time-Voice-Cloning-master\synthesizer\tacotron2.py", line 3, in
from synthesizer.models import create_model
File "D:\Game\Real-Time-Voice-Cloning-master\synthesizer\models_init_.py", line 1, in
from .tacotron import Tacotron
File "D:\Game\Real-Time-Voice-Cloning-master\synthesizer\models\tacotron.py", line 5, in
from synthesizer.models.modules import *
File "D:\Game\Real-Time-Voice-Cloning-master\synthesizer\models\modules.py", line 2, in
import torch
File "C:\Users\Pritam\AppData\Local\Programs\Python\Python37\lib\site-packages\torch_init_.py", line 81, in
ctypes.CDLL(dll)
File "C:\Users\Pritam\AppData\Local\Programs\Python\Python37\lib\ctypes_init_.py", line 364, in init
self._handle = _dlopen(self._name, mode)
OSError: [WinError 126] The specified module could not be found
PS D:\Game\Real-Time-Voice-Cloning-master>

This is what i get after i run this in Powershell. I'm pretty sure I've done everything right at every step! Can anyone figure out what may be missing here?

@ghost
Copy link

ghost commented Jul 8, 2020

@pritxm Looks very similar to this, could be a torch version issue. #260 (comment)

Could you please 1) uninstall torch, 2) visit https://pytorch.org and install the appropriate version , and try again?

@pritxm
Copy link
Author

pritxm commented Jul 8, 2020

Hey @blue-fish thank you for replying. I've uninstalled pytorch. I'm running CUDA 10.0 (as told in the Voice Clone installation guide https://poorlydocumented.com/2019/11/installing-corentinjs-real-time-voice-cloning-project-on-windows-10-from-scratch/ ) But I can't find pytorch for CUDA 10.0. Which one should i get? The only CUDA options I see are 9.2
10.1
10.2
None

@ghost
Copy link

ghost commented Jul 8, 2020

It means that CUDA 10.0 is not available for the latest version of torch, but it is for earlier versions (which should work with the toolbox).

Try this:

pip install  torch==1.4.0+cu100 -f https://download.pytorch.org/whl/torch_stable.html

There is a chance 1.4.0 is not available for Windows, in which case try torch==1.2.0+cu100 instead.

@pritxm
Copy link
Author

pritxm commented Jul 8, 2020

ERROR: Could not find a version that satisfies the requirement torch==1.4.0+cu100 (from versions: 0.1.2, 0.1.2.post1, 0.1.2.post2, 0.4.1, 1.0.0, 1.0.1, 1.1.0, 1.2.0, 1.2.0+cpu, 1.2.0+cu92, 1.3.0, 1.3.0+cpu, 1.3.0+cu92, 1.3.1, 1.3.1+cpu, 1.3.1+cu92, 1.4.0, 1.4.0+cpu, 1.4.0+cu92, 1.5.0, 1.5.0+cpu, 1.5.0+cu101, 1.5.0+cu92, 1.5.1, 1.5.1+cpu, 1.5.1+cu101, 1.5.1+cu92)
ERROR: No matching distribution found for torch==1.4.0+cu100

ERROR: Could not find a version that satisfies the requirement torch==1.2.0+cu100 (from versions: 0.1.2, 0.1.2.post1, 0.1.2.post2, 0.4.1, 1.0.0, 1.0.1, 1.1.0, 1.2.0, 1.2.0+cpu, 1.2.0+cu92, 1.3.0, 1.3.0+cpu, 1.3.0+cu92, 1.3.1, 1.3.1+cpu, 1.3.1+cu92, 1.4.0, 1.4.0+cpu, 1.4.0+cu92, 1.5.0, 1.5.0+cpu, 1.5.0+cu101, 1.5.0+cu92, 1.5.1, 1.5.1+cpu, 1.5.1+cu101, 1.5.1+cu92)
ERROR: No matching distribution found for torch==1.2.0+cu100
Tried both. None worked :(

@ghost
Copy link

ghost commented Jul 8, 2020

Since the installation guide was written, we added CPU support so you're not required to match the torch and CUDA versions. It provides a nice speedup but if you experience a lot of frustration at the install I would just install any recent torch and try the toolbox. Then at a later date, fix your setup to get the GPU speedup if you really want to dive into training or generating a lot of cloned speech.

@ghost
Copy link

ghost commented Jul 8, 2020

Interesting, I found this file and thought 1.2.0 would have CUDA 10.0 support:
https://download.pytorch.org/whl/cu100/torch-1.2.0-cp37-cp37m-win_amd64.whl

You should be able to download that file and then pip install it locally.

@pritxm
Copy link
Author

pritxm commented Jul 8, 2020

Thank you for the link. I'll download and try running it. While it's downloading could you please tell me how can I install it using pip install? I'm new to it.

@ghost
Copy link

ghost commented Jul 8, 2020

This might be able to help you with the installation: https://stackoverflow.com/a/27909082

If it doesn't work I would recommend downloading the latest torch for CPU.

@pritxm
Copy link
Author

pritxm commented Jul 8, 2020

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

:(((
What this might be any idea?

@ghost
Copy link

ghost commented Jul 8, 2020

Is that error message with torch 1.2.0 for CUDA 10.0?

Edit: clip_grad_norm_ exists in torch 1.2.0 so it looks like an installation error with torch, or a path issue. Based on the poorlydocumented.com link you may have missed this step:

After this is installed you have to remove the bundled cuDNN DLL. You can go directly to this directory using %userprofile%\AppData\Local\Programs\Python\Python37\Lib\site-packages\torch\lib in your File Explorer bar. Find cudnn64_7.dll and either rename it (e.g., cudnn64_7.dll.bak) or delete it.

@pritxm
Copy link
Author

pritxm commented Jul 8, 2020

Yes.

@ghost
Copy link

ghost commented Jul 8, 2020

Try these instructions to run the toolbox on CPU. Nothing needs to be uninstalled before starting, we will use a virtual environment.

Make a virtual environment and activate it:

python -m venv env
env\Scripts\activate.bat

Install torch for CPU and the requirements

pip install torch==1.5.1+cpu torchvision==0.6.1+cpu -f https://download.pytorch.org/whl/torch_stable.html
pip install -r requirements.txt

Run the toolbox

python demo_toolbox.py

@pritxm
Copy link
Author

pritxm commented Jul 8, 2020

DUDE! You're awesome this worked! Do I always have to create a virtual environment to use this? Or is there any other way I can play it directly? And thanks alot btw 👍 :)

Here's the log if it helps :

PS D:\Game\Real-Time-Voice-Cloning-master> python demo_toolbox.py
D:\Game\Real-Time-Voice-Cloning-master\encoder\audio.py:13: UserWarning: Unable to import 'webrtcvad'. This package enables noise removal and is recommended.
warn("Unable to import 'webrtcvad'. This package enables noise removal and is recommended.")
2020-07-08 14:45:06.231221: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cudart64_100.dll
Arguments:
datasets_root: None
enc_models_dir: encoder\saved_models
syn_models_dir: synthesizer\saved_models
voc_models_dir: vocoder\saved_models
low_mem: False

Warning: you did not pass a root directory for datasets as argument.
The recognized datasets are:
LibriSpeech/dev-clean
LibriSpeech/dev-other
LibriSpeech/test-clean
LibriSpeech/test-other
LibriSpeech/train-clean-100
LibriSpeech/train-clean-360
LibriSpeech/train-other-500
LibriTTS/dev-clean
LibriTTS/dev-other
LibriTTS/test-clean
LibriTTS/test-other
LibriTTS/train-clean-100
LibriTTS/train-clean-360
LibriTTS/train-other-500
LJSpeech-1.1
VoxCeleb1/wav
VoxCeleb1/test_wav
VoxCeleb2/dev/aac
VoxCeleb2/test/aac
VCTK-Corpus/wav48
Feel free to add your own. You can still use the toolbox by recording samples yourself.

@ghost
Copy link

ghost commented Jul 8, 2020

Glad it is working for you now :D

The virtual environment is suggested, but you don't need it if your default python environment is just like the virtualenv. If you want to try GPU support again, you can deactivate your virtual environment and try following the quoted step in my comment here: #407 (comment)

Seems like renaming/deleting a DLL may be all that's needed. If you don't mind could you try it just to see if that would fix it?

@pritxm
Copy link
Author

pritxm commented Jul 8, 2020

Actually I renamed it already when I was looking at the installation guide. I'll try deleting it.

@ghost
Copy link

ghost commented Jul 8, 2020

I wonder if the problematic DLL would have been installed when you installed torch 1.2.0 just now.

@pritxm
Copy link
Author

pritxm commented Jul 8, 2020

Could you please tell me how to set my default environment as a virtual environment?
And after setting up the virtual environment can I just type python demo_toolbox.py and play it?

@ghost
Copy link

ghost commented Jul 8, 2020

I take it that GPU still doesn't work?

Could you please tell me how to set my default environment as a virtual environment?

I don't know how to automatically launch a virtual environment (but I am sure guides exist). If you only ever use python to use this toolbox, you should try uninstalling the torch 1.2.0 from your default environment and install the working torch. The virtualenv is only needed if you run other programs with conflicting requirements which make a common environment impossible.

And after setting up the virtual environment can I just type python demo_toolbox.py and play it?

Yes, after you have activated a virtual environment with the correct requirements, the toolbox should run.

@pritxm
Copy link
Author

pritxm commented Jul 8, 2020

Actually I haven't tried it yet. Could you tell me how do I deactivate the virtual environment?

I take it that GPU still doesn't work?

Also I can't load any audio files on it. I can record but cannot load any of the mp3 files.
I'm getting this :
Exception : expected str, bytes or os.PathLike object, not NoneType

Would you happen to know why is this happening?

@ghost
Copy link

ghost commented Jul 8, 2020

Could you tell me how do I deactivate the virtual environment?

Type deactivate in your shell.

Exception : expected str, bytes or os.PathLike object, not NoneType

Click the "Browse" button to load a file. The "Load" button only works if you specified <datasets_root> when launching the toolbox. We should disable that button when <datasets_root> is not specified.

@ghost
Copy link

ghost commented Jul 8, 2020

We need to make this toolbox GUI friendlier. Click the "Browse" button and select your mp3 file.

@pritxm
Copy link
Author

pritxm commented Jul 8, 2020

Nothing happens when I select an mp3 or when I load it
I get a blank exception when I browse and select a file
When I try to load I get this
Exception : expected str, bytes or os.PathLike object, not NoneType when I load one

@ghost
Copy link

ghost commented Jul 8, 2020

I am pretty sure the problem is that audioread has no backend. If you look at your terminal it should have the traceback. You can solve that by installing ffmpeg on windows. It is the same issue as #386 or librosa/librosa#219.

If you don't want to install ffmpeg, you should be able to load .wav files without ffmpeg since no conversion is needed.

@pritxm
Copy link
Author

pritxm commented Jul 8, 2020

Dude it worked! Thank you so mcuh for being so patient and helping me! Cheers man! Awesome guy! :D

@pritxm
Copy link
Author

pritxm commented Jul 8, 2020

https://www.youtube.com/watch?v=LSh2tQ6OyZs
I was planning on doing some stuff like this

@ghost
Copy link

ghost commented Jul 8, 2020

You are also to be commended on your determination to get it working. Thanks for uncovering several pain points that need to be improved:

  • For ease of installation, possibly suggest users to install in a virtual environment with torch+cpu, and have an separate guide for GPU support?
  • Need to disable "Load" button in toolbox GUI when launched without <datasets_root> path
  • Should ask users to install ffmpeg as a prerequisite to avoid audioread "no backend" issue

I am going to close this issue now that it is resolved. Best of luck on your project!

@pritxm
Copy link
Author

pritxm commented Jul 9, 2020

@blue-fish do you have a twitter or anything where I can contact you?

@ghost
Copy link

ghost commented Jul 9, 2020

@pritxm I don't have any social media. Why don't you just message me here if needed.

@pritxm
Copy link
Author

pritxm commented Jul 10, 2020

Hey @blue-fish I was wondering how can I add other voices (accents) to the text-to-speech pretrained models?

@ghost
Copy link

ghost commented Jul 10, 2020

@pritxm You will need to use another dataset to continue training of the pretrained models, to fine-tune the vocoder output to have the desired accent. The dataset needs to have the accent which you wish to impart on the text-to-speech output.

We do not have any guides on how to do this and it is outside the scope for what we can provide support for. But if you succeed in doing this please follow up and let us know! Other people have requested this, in #318 and #388 .

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

1 participant