FunAudioLLM / CosyVoice

Multi-lingual large voice generation model, providing inference, training and deployment full-stack ability.
https://funaudiollm.github.io/
Apache License 2.0
6.56k stars 704 forks source link

Pdb 断点 进不去 BaseEncoder #585

Open CallmeZhangChenchen opened 1 month ago

CallmeZhangChenchen commented 1 month ago

encoder_out, encoder_mask = self.text_encoder(text, text_lengths, decoding_chunk_size=1, num_decoding_left_chunks=-1)

如题,我加了个断点,发现根本进不了class BaseEncoder(torch.nn.Module):里面 在这个 forward 里面添加 print 信息,也不会输出

想知道是什么原理

CallmeZhangChenchen commented 1 month ago
> /usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py(1526)_call_impl()
-> or _global_forward_hooks or _global_forward_pre_hooks):
(Pdb) 
> /usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py(1524)_call_impl()
-> if not (self._backward_hooks or self._backward_pre_hooks or self._forward_hooks or self._forward_pre_hooks
(Pdb) 
> /usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py(1527)_call_impl()
-> return forward_call(*args, **kwargs)

(Pdb) s
--Return--
> /usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py(1527)_call_impl()->(tensor([[[ 2....ormBackward0>
), tensor([[[Tru...vice='cuda:0'))
-> return forward_call(*args, **kwargs)

具体现象就是 forward_call(*args, **kwargs) 时按s, 进不了该进的函数,直接 Return 退出

aluminumbox commented 1 month ago

不清楚,具体应该是调用transformer/encoder.py里的forward,我是可以debug进去的

github-actions[bot] commented 6 days ago

This issue is stale because it has been open for 30 days with no activity.