-
Notifications
You must be signed in to change notification settings - Fork 383
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG]: 'NS2Trainer' object has no attribute '_count_parameters' #182
Comments
I think it is false. |
I changes the __count_parameters(model) in TTSTrainer class, to _count_parameters(model) |
Yes, Amphion/models/tts/naturalspeech2/ns2_dataset.py Lines 187 to 196 in d335514
|
yes, also _dump_cfg. yeah. @a897456 # code
code = np.load(self.utt2code_path[utt])
# frame_nums
frame_nums = code.shape[1]
# pitch
pitch = np.load(self.utt2pitch_path[utt])
# duration
duration = np.load(self.utt2duration_path[utt])
# phone_id
phone_id = np.array(
[
*map(
self.phone2id.get,
self.utt2phone[utt].replace("{", "").replace("}", "").split(),
)
]
) |
used acoustic_extractor to create this files?
This is the code in which part of |
code: if cfg.preprocess.extract_acoustic_token:
print('extract_acoustic_token')
if cfg.preprocess.acoustic_token_extractor == "Encodec":
codes = extract_encodec_token(wav_path)
save_feature(
dataset_output, cfg.preprocess.acoustic_token_dir, uid, codes
) pitch: if cfg.preprocess.extract_pitch:
pitch = f0.get_f0(wav, cfg.preprocess)
save_feature(dataset_output, cfg.preprocess.pitch_dir, uid, pitch)
if cfg.preprocess.extract_uv:
assert isinstance(pitch, np.ndarray)
uv = pitch != 0
save_feature(dataset_output, cfg.preprocess.uv_dir, uid, uv) phones: from g2p_en import G2p
preprocess_english(res["Text"], lexicon, g2p) |
THS,but :AttributeError: 'list' object has no attribute 'replace' Amphion/models/tts/naturalspeech2/ns2_dataset.py Lines 224 to 230 in d335514
|
Set True in cfg assert cfg.preprocess.use_phone == True
if cfg.preprocess.use_phone:
self.utt2phone = {}
for utt_info in self.metadata:
dataset = utt_info["Dataset"]
uid = utt_info["Uid"]
utt = "{}_{}".format(dataset, uid)
self.utt2phone[utt] = utt_info["phones"] |
Yes, and I changed the phone_id =... |
Amphion/models/tts/naturalspeech2/ns2_dataset.py Lines 308 to 313 in d335514
in this code: phone_nums =len(phone_id)=len(tensor(1,X))=1, so phone_nums always=1 because: phone_id = torch.from_numpy(phone_id).unsqueeze(0) so clip_phone_nums=1 but assert clip_phone_nums < phone_nums and clip_phone_nums >= 1 How to solve it,please? |
1 similar comment
Amphion/models/tts/naturalspeech2/ns2_dataset.py Lines 308 to 313 in d335514
in this code: phone_nums =len(phone_id)=len(tensor(1,X))=1, so phone_nums always=1 because: phone_id = torch.from_numpy(phone_id).unsqueeze(0) so clip_phone_nums=1 but assert clip_phone_nums < phone_nums and clip_phone_nums >= 1 How to solve it,please? |
Hi,@a897456 |
我在群里看到你问了,这个BUG作者应该还没修复。 |
|
@CreepJoye and @a897456 Have you fix all these bugs? |
|
@chazo1994 Have you fix all these bugs? I have been modifying the code, but new issues keep arising. |
@CreepJoye Not yet, I have fixed a lot of bug, but there is still an error in the code extract (Encodec) which may not be implemented. I push my code in this fork:https://github.com/chazo1994/Amphion You can contact me with my email [email protected] or my linkedin: https://www.linkedin.com/in/thinh-nguyen-a06658133/ or any platform that you used such as discord. I would be honored if we could discuss Neuralspeech2, Neuralspeech3 or any SOTA Speech generation model. |
Amphion/models/tts/naturalspeech2/ns2_trainer.py
Lines 134 to 136 in d335514
Traceback (most recent call last):
File "E:\00\Amphion-main_old\bins\tts\train.py", line 130, in
main()
File "E:\00\Amphion-main_old\bins\tts\train.py", line 104, in main
trainer = build_trainer(args, cfg)
File "E:\00\Amphion-main_old\bins\tts\train.py", line 26, in build_trainer
trainer = trainer_class(args, cfg)#NS2Trainer
File "E:\00\Amphion-main_old\models\tts\naturalspeech2\ns2_trainer.py", line 135, in init
f"Model parameters: {self._count_parameters(self.model)/1e6:.2f}M"
AttributeError: 'NS2Trainer' object has no attribute '_count_parameters'
The text was updated successfully, but these errors were encountered: