muzic icon indicating copy to clipboard operation
muzic copied to clipboard

telemelody: how can I get dict.trend.txt?

Open Cescfangs opened this issue 2 years ago • 3 comments

When inference using pretrained models, I got error about missing file:

FileNotFoundError: [Errno 2] No such file or directory: 'data-bin/template2melody_zh/dict.trend.txt'

I have dict.beat.txt and dict.lyric.txt copied from training dir, do I need to run training first to get the trend file?

Cescfangs avatar Mar 29 '22 11:03 Cescfangs

No. In fact, you just need to run the gen_dictionary function in gen.py to get the dict (ref: https://github.com/microsoft/muzic/blob/main/telemelody/training/template2melody/gen.py#L180

jzq2000 avatar Apr 01 '22 06:04 jzq2000

Hello I am trying to run the same inference portion. This is what I have in my folders, but seem to keep getting the same error:

checkpoints
- lyric2rhythm
---- checkpoint_best.pt (Also are these the lyric2rhythem_en_best.pt files that are provided? Do we torch.load them 1st?
-template2melody
---- checkpoint_best.pt
data-bin
-lyric2rhythm
---- dict.beat.txt
---- dict.lyric.txt
-template2melody
---- dict.trend.txt
---- dict.note.txt

Error:

2022-04-14 01:37:31 | INFO | fairseq.file_utils | loading archive file checkpoints/lyric2rhythm_en_best 2022-04-14 01:37:31 | INFO | fairseq.file_utils | loading archive file data-bin/lyric2rhythm_en_best Traceback (most recent call last): File "infer_en.py", line 154, in data_name_or_path=f'data-bin/{lyric2beat_prefix}', File "/usr/local/lib/python3.7/dist-packages/fairseq/models/fairseq_model.py", line 265, in from_pretrained **kwargs, File "/usr/local/lib/python3.7/dist-packages/fairseq/hub_utils.py", line 72, in from_pretrained arg_overrides=kwargs, File "/usr/local/lib/python3.7/dist-packages/fairseq/checkpoint_utils.py", line 279, in load_model_ensemble_and_task state = load_checkpoint_to_cpu(filename, arg_overrides) File "/usr/local/lib/python3.7/dist-packages/fairseq/checkpoint_utils.py", line 231, in load_checkpoint_to_cpu setattr(args, arg_name, arg_val) AttributeError: 'NoneType' object has no attribute 'data'

Should I only but the dict.beat.txt file in both? The txt file shouldn't have an attribute called 'data' right?

benfenison avatar Apr 14 '22 23:04 benfenison

Hi @benfenison , you can refer to this link https://github.com/microsoft/muzic/issues/29#issuecomment-1019877476

jzq2000 avatar Apr 15 '22 08:04 jzq2000