vall-e icon indicating copy to clipboard operation
vall-e copied to clipboard

torch.load() returned a dict when inference

Open JunZhan2000 opened this issue 1 year ago • 3 comments

when run inference code, loading the model, but torch.load() returned a dict get error:

File "vall-e/vall_e/main.py", line 30, in main ar = torch.load(args.ar_ckpt).to(args.device) AttributeError: 'dict' object has no attribute 'to'

JunZhan2000 avatar Mar 10 '23 14:03 JunZhan2000

I trained 10 samples to generate the same error in the audio times. python -m vall_e 'welcome' ref_path/2.wav out_path/2.wav --ar-ckpt ckpts/test/ar/model/default/mp_rank_00_model_states.pt

hsdzhao avatar Mar 23 '23 10:03 hsdzhao

I am receiving the same error

JonathanColetti avatar May 12 '23 16:05 JonathanColetti

You need to export your freshly trained models first, then the error is gone!

For example:

python3 -m vall_e.export ~/vall-e/ckpts/LJSpeech-1.1/ar/model/default/mp_rank_00_model_states.pt yaml=config/LJSpeech-1.1/ar.yml
python3 -m vall_e.export ~/vall-e/ckpts/LJSpeech-1.1/nar/model/default/mp_rank_00_model_states.pt yaml=config/LJSpeech-1.1/nar.yml

axe312ger avatar May 13 '23 12:05 axe312ger