只有CPU没有GPU的机器,始终无法生成成功,只有2秒的电流音
- Dominant language
- Python
- Stars
- 36.9k
- Forks
- 5.2k
- PR merge metrics
- No merged PRs in 30d
Description
**python版本:**
`C:\Program Files (x86)\MockingBird-main>python -V
Python 3.9.9`
**各类库文件版本**
`C:\Program Files (x86)\MockingBird-main>pip list
Package Version
----------------------- ------------
absl-py 1.0.0
aniso8601 9.0.1
appdirs 1.4.4
attrs 21.2.0
audioread 2.1.9
cachetools 4.2.4
certifi 2021.10.8
cffi 1.15.0
charset-normalizer 2.0.8
click 8.0.3
colorama 0.4.4
cycler 0.11.0
decorator 5.1.0
dill 0.3.4
Flask 2.0.2
Flask-Cors 3.0.10
flask-restx 0.5.1
Flask-WTF 1.0.0
fonttools 4.28.2
gevent 21.8.0
google-auth 2.3.3
google-auth-oauthlib 0.4.6
greenlet 1.1.2
grpcio 1.42.0
idna 3.3
importlib-metadata 4.8.2
inflect 5.3.0
itsdangerous 2.0.1
Jinja2 3.0.3
joblib 1.1.0
jsonpatch 1.32
jsonpointer 2.2
jsonschema 4.2.1
kiwisolver 1.3.2
librosa 0.8.1
llvmlite 0.37.0
Markdown 3.3.6
MarkupSafe 2.0.1
matplotlib 3.5.0
multiprocess 0.70.12.2
numba 0.54.1
numpy 1.19.3
oauthlib 3.1.1
packaging 21.3
Pillow 8.4.0
pip 21.3.1
pooch 1.5.2
protobuf 3.19.1
pyasn1 0.4.8
pyasn1-modules 0.2.8
pycparser 2.21
pynndescent 0.5.5
pyparsing 3.0.6
pypinyin 0.44.0
PyQt5 5.15.6
PyQt5-Qt5 5.15.2
PyQt5-sip 12.9.0
pyrsistent 0.18.0
python-dateutil 2.8.2
pytz 2021.3
pyzmq 22.3.0
requests 2.26.0
requests-oauthlib 1.3.0
resampy 0.2.2
rsa 4.8
scikit-learn 1.0.1
scipy 1.7.3
setuptools 59.4.0
setuptools-scm 6.3.2
six 1.16.0
sounddevice 0.4.3
SoundFile 0.10.3.post1
tensorboard 2.7.0
tensorboard-data-server 0.6.1
tensorboard-plugin-wit 1.8.0
threadpoolctl 3.0.0
tomli 1.2.2
torch 1.10.0
torchaudio 0.10.0
torchfile 0.1.0
torchvision 0.11.1
tornado 6.1
tqdm 4.62.3
typing_extensions 4.0.0
umap-learn 0.5.2
Unidecode 1.3.2
urllib3 1.26.7
visdom 0.1.8.9
webrtcvad-wheels 2.0.10.post2
websocket-client 1.2.1
Werkzeug 2.0.2
wheel 0.37.0
WTForms 3.0.0
zipp 3.6.0
zope.event 4.5.0
zope.interface 5.4.0`
**报错信息():**
`C:\Program Files (x86)\MockingBird-main>python web.py
Loaded synthesizer models: 2
Loaded encoder "pretrained.pt" trained to step 1594501
Building Wave-RNN
Trainable Parameters: 4.481M
Loading model weights at vocoder\saved_models\pretrained\pretrained.pt
Building hifigan
Loading 'vocoder\saved_models\pretrained\g_hifigan.pt'
Complete.
Removing weight norm...
Web server:http://localhost:8080
127.0.0.1 - - [2021-11-29 20:10:48] "GET / HTTP/1.1" 200 16488 0.019554
127.0.0.1 - - [2021-11-29 20:10:48] "GET /static/js/wav.js HTTP/1.1" 304 137 0.178753
127.0.0.1 - - [2021-11-29 20:10:49] "GET /static/js/frequency.histogram.view.js HTTP/1.1" 304 158 0.003109
127.0.0.1 - - [2021-11-29 20:10:49] "GET /static/js/mp3.js HTTP/1.1" 304 137 0.003626
127.0.0.1 - - [2021-11-29 20:10:49] "GET /static/js/jquery.js HTTP/1.1" 304 140 0.004169
127.0.0.1 - - [2021-11-29 20:10:49] "GET /static/js/mp3-engine.js HTTP/1.1" 304 144 0.003167
127.0.0.1 - - [2021-11-29 20:10:49] "GET /static/js/lib.fft.js HTTP/1.1" 304 141 0.002072
127.0.0.1 - - [2021-11-29 20:10:49] "GET /static/js/recorder-core.js HTTP/1.1" 304 147 0.003670
127.0.0.1 - - [2021-11-29 20:10:49] "GET /static/img/bird.png HTTP/1.1" 304 139 0.004651
127.0.0.1 - - [2021-11-29 20:10:49] "GET /api/synthesizers/ HTTP/1.1" 200 264 0.001592
Synthesizer using device: cpu
using synthesizer model: synthesizer\saved_models\ceshi.pt
Trainable Parameters: 32.869M
[2021-11-29 20:11:04,797] ERROR in app: Exception on /api/synthesize [POST]
Traceback (most recent call last):
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\site-packages\flask\app.py", line 2073, in wsgi_app
response = self.full_dispatch_request()
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\site-packages\flask\app.py", line 1518, in full_dispatch_request
rv = self.handle_user_exception(e)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\site-packages\flask_restx\api.py", line 672, in error_router
return original_handler(e)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\site-packages\flask\app.py", line 1516, in full_dispatch_request
rv = self.dispatch_request()
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\site-packages\flask\app.py", line 1502, in dispatch_request
return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
File "C:\Program Files (x86)\MockingBird-main\web\__init__.py", line 108, in synthesize
specs = current_synt.synthesize_spectrograms(texts, embeds)
File "C:\Program Files (x86)\MockingBird-main\synthesizer\inference.py", line 87, in synthesize_spectrograms
self.load()
File "C:\Program Files (x86)\MockingBird-main\synthesizer\inference.py", line 65, in load
self._model.load(self.model_fpath)
File "C:\Program Files (x86)\MockingBird-main\synthesizer\models\tacotron.py", line 544, in load
checkpoint = torch.load(str(path))
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\site-packages\torch\serialization.py", line 607, in load
return _load(opened_zipfile, map_location, pickle_module, **pickle_load_args)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\site-packages\torch\serialization.py", line 882, in _load
result = unpickler.load()
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\site-packages\torch\serialization.py", line 857, in persistent_load
load_tensor(data_type, size, key, _maybe_decode_ascii(location))
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\site-packages\torch\serialization.py", line 846, in load_tensor
loaded_storages[key] = restore_location(storage, location)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\site-packages\torch\serialization.py", line 175, in default_restore_location
result = fn(storage, location)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\site-packages\torch\serialization.py", line 151, in _cuda_deserialize
device = validate_cuda_device(location)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\site-packages\torch\serialization.py", line 135, in validate_cuda_device
raise RuntimeError('Attempting to deserialize object on a CUDA '
RuntimeError: Attempting to deserialize object on a CUDA device but torch.cuda.is_available() is False. If you are running on a CPU-only machine, please use torch.load with map_location=torch.device('cpu') to map your storages to the CPU.
127.0.0.1 - - [2021-11-29 20:11:04] "POST /api/synthesize HTTP/1.1" 500 426 2.548924
`
Contributor guide
No contributing guide indexed for this repository
Research direction
Reproduce the CPU-only request through web.py, then inspect synthesizer/inference.py and synthesizer/models/tacotron.py at the model-loading path shown in the traceback. Verify the behavior of the CUDA-trained checkpoint on a CPU-only machine and confirm that /api/synthesize completes successfully without the CUDA deserialization error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, pytorch
- Domain
- machine-learning
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 55/100