if name == 'main':
from multiprocessing import freeze_support
freeze_support()
main()
An error occurs in that code.
Traceback (most recent call last):
File "test.py", line 62, in
main()
File "test.py", line 56, in main
trainer.train()
File "C:\naturalspeech2-pytorch\naturalspeech2_pytorch\naturalspeech2_pytorch.py", line 1875, in train
loss = self.model(data)
File "C:\Users\user.conda\envs\svc\lib\site-packages\torch\nn\modules\module.py", line 1511, in _wrapped_call_impl
return self._call_impl(*args, *kwargs)
File "C:\Users\user.conda\envs\svc\lib\site-packages\torch\nn\modules\module.py", line 1520, in _call_impl
return forward_call(args, **kwargs)
File "C:\naturalspeech2-pytorch\naturalspeech2_pytorch\naturalspeech2_pytorch.py", line 1522, in forward
text_max_length = text.shape[-1]
AttributeError: 'NoneType' object has no attribute 'shape'
Can you provide the training code for that model?
import torch
from naturalspeech2_pytorch import Trainer, EncodecWrapper, Model, NaturalSpeech2, SpeechPromptEncoder
codec = EncodecWrapper()
def main(): model = Model( dim = 128, depth = 6, dim_prompt = 512, cond_drop_prob = 0.25, condition_on_prompt = True )
if name == 'main': from multiprocessing import freeze_support freeze_support() main()
An error occurs in that code.
Traceback (most recent call last): File "test.py", line 62, in
main()
File "test.py", line 56, in main
trainer.train()
File "C:\naturalspeech2-pytorch\naturalspeech2_pytorch\naturalspeech2_pytorch.py", line 1875, in train
loss = self.model(data)
File "C:\Users\user.conda\envs\svc\lib\site-packages\torch\nn\modules\module.py", line 1511, in _wrapped_call_impl
return self._call_impl(*args, *kwargs)
File "C:\Users\user.conda\envs\svc\lib\site-packages\torch\nn\modules\module.py", line 1520, in _call_impl
return forward_call(args, **kwargs)
File "C:\naturalspeech2-pytorch\naturalspeech2_pytorch\naturalspeech2_pytorch.py", line 1522, in forward
text_max_length = text.shape[-1]
AttributeError: 'NoneType' object has no attribute 'shape'