coqui-ai / TTS

🐸💬 - a deep learning toolkit for Text-to-Speech, battle-tested in research and production
http://coqui.ai
Mozilla Public License 2.0
35.29k stars 4.31k forks source link

FutureWarning #3835

Open madey83 opened 3 months ago

madey83 commented 3 months ago

Describe the bug

i have installed TTS by following this steps:

sudo apt-get update && sudo apt-get upgrade -y

git clone https://github.com/coqui-ai/TTS/ cd TTS make system-deps # only on Linux systems. make install

python3 -m venv TTS source ./TTS/bin/activate pip list pip3 install torch torchvision torchaudio pip install pysrt pydub

test if cuda is installed correclty and visible by python3

python import torch torch.cuda.is_available() torch.cuda.device_count() torch.cuda.current_device() torch.cuda.get_device_name(0)

pip install tts setuptools wheel -U

then i execute this command: tts --model_name tts_models/multilingual/multi-dataset/xtts_v2 --list_speaker_idx

and received this output:

/home/luke/TTS/TTS/lib/python3.10/site-packages/TTS/tts/layers/xtts/xtts_manager.py:5: FutureWarning: You are using torch.load with weights_only=False (the current default value), which uses the default pickle module implicitly. It is possible to construct malicious pickle data which will execute arbitrary code during unpickling (See https://github.com/pytorch/pytorch/blob/main/SECURITY.md#untrusted-models for more details). In a future release, the default value for weights_only will be flipped to True. This limits the functions that could be executed during unpickling. Arbitrary objects will no longer be allowed to be loaded via this mode unless they are explicitly allowlisted by the user via torch.serialization.add_safe_globals. We recommend you start setting weights_only=True for any use case where you don't have full control of the loaded file. Please open an issue on GitHub for any issues related to this experimental feature. self.speakers = torch.load(speaker_file_path)

/home/luke/TTS/TTS/lib/python3.10/site-packages/TTS/utils/io.py:54: FutureWarning: You are using torch.load with weights_only=False (the current default value), which uses the default pickle module implicitly. It is possible to construct malicious pickle data which will execute arbitrary code during unpickling (See https://github.com/pytorch/pytorch/blob/main/SECURITY.md#untrusted-models for more details). In a future release, the default value for weights_only will be flipped to True. This limits the functions that could be executed during unpickling. Arbitrary objects will no longer be allowed to be loaded via this mode unless they are explicitly allowlisted by the user via torch.serialization.add_safe_globals. We recommend you start setting weights_only=True for any use case where you don't have full control of the loaded file. Please open an issue on GitHub for any issues related to this experimental feature. return torch.load(f, map_location=map_location, **kwargs)

i have no idea if i did installation wrongly or my WSL ubuntu is broken....

To Reproduce

as above described...

Expected behavior

No response

Logs

No response

Environment

(TTS) root@DESKTOP-H42AEU4:/home/luke/TTS# python collect_env_info.py
{
    "CUDA": {
        "GPU": [
            "NVIDIA GeForce RTX 2060"
        ],
        "available": true,
        "version": "12.1"
    },
    "Packages": {
        "PyTorch_debug": false,
        "PyTorch_version": "2.4.0+cu121",
        "TTS": "0.22.0",
        "numpy": "1.22.0"
    },
    "System": {
        "OS": "Linux",
        "architecture": [
            "64bit",
            "ELF"
        ],
        "processor": "x86_64",
        "python": "3.10.12",
        "version": "#1 SMP Fri Mar 29 23:14:13 UTC 2024"
    }
}

(TTS) root@DESKTOP-H42AEU4:/home/luke/TTS# pip list
Package                  Version
------------------------ -----------
absl-py                  2.1.0
aiohttp                  3.9.5
aiosignal                1.3.1
annotated-types          0.7.0
anyascii                 0.3.2
async-timeout            4.0.3
attrs                    23.2.0
audioread                3.0.1
Babel                    2.15.0
bangla                   0.0.2
blinker                  1.8.2
blis                     0.7.11
bnnumerizer              0.0.2
bnunicodenormalizer      0.1.7
catalogue                2.0.10
certifi                  2024.7.4
cffi                     1.16.0
chardet                  5.2.0
charset-normalizer       3.3.2
click                    8.1.7
cloudpathlib             0.18.1
confection               0.1.5
contourpy                1.2.1
coqpit                   0.0.17
cycler                   0.12.1
cymem                    2.0.8
Cython                   3.0.10
dateparser               1.1.8
decorator                5.1.1
docopt                   0.6.2
einops                   0.8.0
encodec                  0.1.1
filelock                 3.15.4
Flask                    3.0.3
fonttools                4.53.1
frozenlist               1.4.1
fsspec                   2024.6.1
g2pkk                    0.1.2
grpcio                   1.65.1
gruut                    2.2.3
gruut-ipa                0.13.0
gruut-lang-de            2.0.1
gruut-lang-en            2.0.1
gruut-lang-es            2.0.1
gruut-lang-fr            2.0.2
hangul-romanize          0.1.0
huggingface-hub          0.24.2
idna                     3.7
inflect                  7.3.1
itsdangerous             2.2.0
jamo                     0.4.1
jieba                    0.42.1
Jinja2                   3.1.4
joblib                   1.4.2
jsonlines                1.2.0
kiwisolver               1.4.5
langcodes                3.4.0
language_data            1.2.0
lazy_loader              0.4
librosa                  0.10.0
llvmlite                 0.43.0
marisa-trie              1.2.0
Markdown                 3.6
markdown-it-py           3.0.0
MarkupSafe               2.1.5
matplotlib               3.8.4
mdurl                    0.1.2
more-itertools           10.3.0
mpmath                   1.3.0
msgpack                  1.0.8
multidict                6.0.5
murmurhash               1.0.10
networkx                 2.8.8
nltk                     3.8.1
num2words                0.5.13
numba                    0.60.0
numpy                    1.22.0
nvidia-cublas-cu12       12.1.3.1
nvidia-cuda-cupti-cu12   12.1.105
nvidia-cuda-nvrtc-cu12   12.1.105
nvidia-cuda-runtime-cu12 12.1.105
nvidia-cudnn-cu12        9.1.0.70
nvidia-cufft-cu12        11.0.2.54
nvidia-curand-cu12       10.3.2.106
nvidia-cusolver-cu12     11.4.5.107
nvidia-cusparse-cu12     12.1.0.106
nvidia-nccl-cu12         2.20.5
nvidia-nvjitlink-cu12    12.5.82
nvidia-nvtx-cu12         12.1.105
packaging                24.1
pandas                   1.5.3
pillow                   10.4.0
pip                      22.0.2
platformdirs             4.2.2
pooch                    1.8.2
preshed                  3.0.9
protobuf                 4.25.4
psutil                   6.0.0
pycparser                2.22
pydantic                 2.8.2
pydantic_core            2.20.1
pydub                    0.25.1
Pygments                 2.18.0
pynndescent              0.5.13
pyparsing                3.1.2
pypinyin                 0.51.0
pysbd                    0.3.4
pysrt                    1.1.2
python-crfsuite          0.9.10
python-dateutil          2.9.0.post0
pytz                     2024.1
PyYAML                   6.0.1
regex                    2024.7.24
requests                 2.32.3
rich                     13.7.1
safetensors              0.4.3
scikit-learn             1.5.1
scipy                    1.11.4
setuptools               71.1.0
shellingham              1.5.4
six                      1.16.0
smart-open               7.0.4
soundfile                0.12.1
soxr                     0.4.0
spacy                    3.7.5
spacy-legacy             3.0.12
spacy-loggers            1.0.5
srsly                    2.4.8
SudachiDict-core         20240716
SudachiPy                0.6.8
sympy                    1.13.1
tensorboard              2.17.0
tensorboard-data-server  0.7.2
thinc                    8.2.5
threadpoolctl            3.5.0
tokenizers               0.19.1
torch                    2.4.0
torchaudio               2.4.0
torchvision              0.19.0
tqdm                     4.66.4
trainer                  0.0.36
transformers             4.43.2
triton                   3.0.0
TTS                      0.22.0
typeguard                4.3.0
typer                    0.12.3
typing_extensions        4.12.2
tzlocal                  5.2
umap-learn               0.5.6
Unidecode                1.3.8
urllib3                  2.2.2
wasabi                   1.1.3
weasel                   0.4.1
Werkzeug                 3.0.3
wheel                    0.43.0
wrapt                    1.16.0
yarl                     1.9.4

Additional context

No response

eginhard commented 3 months ago

Thanks for raising this. It's just a warning, so you can ignore it for now. I'll eventually add a fix to our fork (this repo is not updated anymore), so that it will work with future Pytorch versions.

amira133 commented 3 months ago

I also have get this error ModuleNotFoundError: No module named 'torch.privateuseone' after installing lastest version of torch.

eginhard commented 3 months ago

I also have get this error ModuleNotFoundError: No module named 'torch.privateuseone' after installing lastest version of torch.

@amira133 Could you post the full error stacktrace, not just the last line?

amira133 commented 3 months ago

@eginhard here you are FutureWarning: You are using torch.load with weights_only=False (the current default value), which uses the default pickle module implicitly. It is possible to construct malicious pickle data which will execute arbitrary code during unpickling (See https://github.com/pytorch/pytorch/blob/main/SECURITY.md#untrusted-models for more details). In a future release, the default value for weights_only will be flipped to True. This limits the functions that could be executed during unpickling. Arbitrary objects will no longer be allowed to be loaded via this mode unless they are explicitly allowlisted by the user via torch.serialization.add_safe_globals. We recommend you start setting weights_only=True for any use case where you don't have full control of the loaded file. Please open an issue on GitHub for any issues related to this experimental feature. net.load_state_dict(torch.load(model_dir)) Traceback (most recent call last): File ".\u2net_test.py", line 276, in main() File ".\u2net_test.py", line 243, in main net.load_state_dict(torch.load(model_dir)) File "xxxx\lib\site-packages\torch\serialization.py", line 1097, in load return _load( File "xxxx\lib\site-packages\torch\serialization.py", line 1525, in _load result = unpickler.load() File "xxxx\lib\site-packages\torch_utils.py", line 333, in _rebuild_device_tensor_from_numpy tensor = torch.from_numpy(data).to(dtype=dtype, device=device) ModuleNotFoundError: No module named 'torch.privateuseone'

stale[bot] commented 1 month ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. You might also look our discussion channels.

rose07 commented 3 weeks ago

https://tts.byylook.com/ai/text-to-speech