yangdongchao / Text-to-sound-Synthesis

The source code of our paper "Diffsound: discrete diffusion model for text-to-sound generation"

Home Page:http://dongchaoyang.top/text-to-sound-synthesis-demo/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ImportError: cannot import name 'rank_zero_warn' from 'pytorch_lightning.utilities.distributed'

dto opened this issue · comments

commented

(specvqgan) dto@thexder:/apdcephfs/share_1316500/donchaoyang/code3/Text-to-sound-Synthesis/Diffsound$ python3 evaluation/generate_samples_batch.py
/home/dto/.local/lib/python3.8/site-packages/torch/cuda/init.py:83: UserWarning: CUDA initialization: The NVIDIA driver on your system is too old (found version 10010). Please update your GPU driver by downloading and installing a new version from the URL: http://www.nvidia.com/Download/index.aspx Alternatively, go to: https://pytorch.org to install a PyTorch version that has been compiled with your version of the CUDA driver. (Triggered internally at ../c10/cuda/CUDAFunctions.cpp:109.)
return torch._C._cuda_getDeviceCount() > 0
/home/dto/.local/lib/python3.8/site-packages/torch/amp/autocast_mode.py:198: UserWarning: User provided device_type of 'cuda', but CUDA is not available. Disabling
warnings.warn('User provided device_type of 'cuda', but CUDA is not available. Disabling')
Traceback (most recent call last):
File "evaluation/generate_samples_batch.py", line 204, in
Diffsound = Diffsound(config=config_path, path=pretrained_model_path, ckpt_vocoder=ckpt_vocoder)
File "evaluation/generate_samples_batch.py", line 44, in init
self.info = self.get_model(ema=True, model_path=path, config_path=config)
File "evaluation/generate_samples_batch.py", line 64, in get_model
model = build_model(config) #加载 dalle model
File "evaluation/../sound_synthesis/modeling/build.py", line 5, in build_model
return instantiate_from_config(config['model'])
File "evaluation/../sound_synthesis/utils/misc.py", line 132, in instantiate_from_config
return cls(**config.get("params", dict()))
File "evaluation/../sound_synthesis/modeling/models/dalle_spec.py", line 38, in init
self.init_content_codec_from_ckpt(content_codec_config)
File "evaluation/../sound_synthesis/modeling/models/dalle_spec.py", line 46, in init_content_codec_from_ckpt
model = instantiate_from_config(content_codec_config) # 得到第一阶段的模型
File "evaluation/../sound_synthesis/utils/misc.py", line 131, in instantiate_from_config
cls = getattr(importlib.import_module(module, package=None), cls)
File "/home/dto/miniconda3/envs/specvqgan/lib/python3.8/importlib/init.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1014, in _gcd_import
File "", line 991, in _find_and_load
File "", line 975, in _find_and_load_unlocked
File "", line 671, in _load_unlocked
File "", line 783, in exec_module
File "", line 219, in _call_with_frames_removed
File "evaluation/../sound_synthesis/modeling/codecs/spec_codec/vqgan.py", line 3, in
import pytorch_lightning as pl
File "/home/dto/.local/lib/python3.8/site-packages/pytorch_lightning/init.py", line 42, in
import("pkg_resources").declare_namespace(name)
File "/home/dto/miniconda3/envs/specvqgan/lib/python3.8/site-packages/pkg_resources/init.py", line 2304, in declare_namespace
_handle_ns(packageName, path_item)
File "/home/dto/miniconda3/envs/specvqgan/lib/python3.8/site-packages/pkg_resources/init.py", line 2237, in _handle_ns
loader.load_module(packageName)
File "/home/dto/miniconda3/envs/specvqgan/lib/python3.8/site-packages/pytorch_lightning/init.py", line 28, in
from pytorch_lightning import metrics # noqa: E402
File "/home/dto/miniconda3/envs/specvqgan/lib/python3.8/site-packages/pytorch_lightning/metrics/init.py", line 14, in
from pytorch_lightning.metrics.classification import ( # noqa: F401
File "/home/dto/miniconda3/envs/specvqgan/lib/python3.8/site-packages/pytorch_lightning/metrics/classification/init.py", line 14, in
from pytorch_lightning.metrics.classification.accuracy import Accuracy # noqa: F401
File "/home/dto/miniconda3/envs/specvqgan/lib/python3.8/site-packages/pytorch_lightning/metrics/classification/accuracy.py", line 19, in
from pytorch_lightning.metrics.metric import Metric
File "/home/dto/miniconda3/envs/specvqgan/lib/python3.8/site-packages/pytorch_lightning/metrics/metric.py", line 20, in
from pytorch_lightning.utilities.distributed import rank_zero_warn
ImportError: cannot import name 'rank_zero_warn' from 'pytorch_lightning.utilities.distributed' (/home/dto/.local/lib/python3.8/site-packages/pytorch_lightning/utilities/distributed.py)
(specvqgan) dto@thexder:/apdcephfs/share_1316500/donchaoyang/code3/Text-to-sound-Synthesis/Diffsound$

Please make sure your cuda can be used.

commented

Oh. Is there any way to use the project without CUDA? I have Radeon chips, not NVidia...

commented

I am trying to use CPU-only pytorch, as well as trying with AMD ROCm. I will let you know what happens.