使用新語料 toolbox inference錯誤
- Dominant language
- Python
- Stars
- 36.9k
- Forks
- 5.2k
- PR merge metrics
- No merged PRs in 30d
Description
最近使用了一個新的語料庫去訓練synthesizer(沒有使用作者提供的語料),訓練格式都沒有改。但是將模型拿去toolbox做inference的時候遇到下列的錯誤。
`Feel free to add your own. You can still use the toolbox by recording samples yourself.
Loaded encoder "pretrained.pt" trained to step 1564501
Synthesizer using device: cpu
Trainable Parameters: 30.875M
Traceback (most recent call last):
File "C:\Users\VC\MockingBird\toolbox\__init__.py", line 123, in
func = lambda: self.synthesize() or self.vocode()
File "C:\Users\VC\MockingBird\toolbox\__init__.py", line 237, in synthesize
specs = self.synthesizer.synthesize_spectrograms(texts, embeds)
File "C:\Users\VC\MockingBird\synthesizer\inference.py", line 87, in synthesize_spectrograms
self.load()
File "C:\Users\VC\MockingBird\synthesizer\inference.py", line 65, in load
self._model.load(self.model_fpath)
File "C:\Users\VC\MockingBird\synthesizer\models\tacotron.py", line 497, in load
self.load_state_dict(checkpoint["model_state"])
File "C:\Users\anaconda3\envs\VC-test\lib\site-packages\torch\nn\modules\module.py", line 1407, in load_state_dict
self.__class__.__name__, "\n\t".join(error_msgs)))
RuntimeError: Error(s) in loading state_dict for Tacotron:
Unexpected key(s) in state_dict: "gst.encoder.convs.0.weight", "gst.encoder.convs.0.bias", "gst.encoder.convs.1.weight", "gst.encoder.convs.1.bias", "gst.encoder.convs.2.weight", "gst.encoder.convs.2.bias", "gst.encoder.convs.3.weight", "gst.encoder.convs.3.bias", "gst.encoder.convs.4.weight", "gst.encoder.convs.4.bias", "gst.encoder.convs.5.weight", "gst.encoder.convs.5.bias", "gst.encoder.bns.0.weight", "gst.encoder.bns.0.bias", "gst.encoder.bns.0.running_mean", "gst.encoder.bns.0.running_var", "gst.encoder.bns.0.num_batches_tracked", "gst.encoder.bns.1.weight", "gst.encoder.bns.1.bias", "gst.encoder.bns.1.running_mean", "gst.encoder.bns.1.running_var", "gst.encoder.bns.1.num_batches_tracked", "gst.encoder.bns.2.weight", "gst.encoder.bns.2.bias", "gst.encoder.bns.2.running_mean", "gst.encoder.bns.2.running_var", "gst.encoder.bns.2.num_batches_tracked", "gst.encoder.bns.3.weight", "gst.encoder.bns.3.bias", "gst.encoder.bns.3.running_mean", "gst.encoder.bns.3.running_var", "gst.encoder.bns.3.num_batches_tracked", "gst.encoder.bns.4.weight", "gst.encoder.bns.4.bias", "gst.encoder.bns.4.running_mean", "gst.encoder.bns.4.running_var", "gst.encoder.bns.4.num_batches_tracked", "gst.encoder.bns.5.weight", "gst.encoder.bns.5.bias", "gst.encoder.bns.5.running_mean", "gst.encoder.bns.5.running_var", "gst.encoder.bns.5.num_batches_tracked", "gst.encoder.gru.weight_ih_l0", "gst.encoder.gru.weight_hh_l0", "gst.encoder.gru.bias_ih_l0", "gst.encoder.gru.bias_hh_l0", "gst.stl.embed", "gst.stl.attention.W_query.weight", "gst.stl.attention.W_key.weight", "gst.stl.attention.W_value.weight".`
Contributor guide
No contributing guide indexed for this repository
Research direction
Start at toolbox/__init__.py in synthesize(), then follow synthesizer/inference.py:65 and synthesizer/models/tacotron.py:497 where the checkpoint is loaded. Compare the model state expected by Tacotron with the checkpoint keys listed in the traceback. Done means the model trained with the new corpus loads successfully and runs toolbox inference without the unexpected gst keys error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, pytorch
- Domain
- ai, machine-learning
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100