[ACL 2024] Official PyTorch code for extracting features and training downstream models with emotion2vec: Self-Supervised Pre-Training for Speech Emotion Representation
617
stars
43
forks
source link
AttributeError: 'NoneType' object has no attribute 'task' #47
I've tried many versions and encountered this issue every time. I would greatly appreciate it if you could provide a solution. Thank you very much.
Traceback (most recent call last):
File "/home2/ZZT/emotion2vec-main/scripts/extract_features.py", line 76, in
main()
File "/home2/ZZT/emotion2vec-main/scripts/extract_features.py", line 44, in main
model, cfg, task = fairseq.checkpoint_utils.load_model_ensemble_and_task([checkpoint_dir]) #加载模型
File "/home2/ZZT/anaconda3/envs/interspeech/lib/python3.8/site-packages/fairseq/checkpoint_utils.py", line 279, in load_model_ensemble_and_task
state = load_checkpoint_to_cpu(filename, arg_overrides)
File "/home2/ZZT/anaconda3/envs/interspeech/lib/python3.8/site-packages/fairseq/checkpoint_utils.py", line 232, in load_checkpoint_to_cpu
state = _upgrade_state_dict(state)
File "/home2/ZZT/anaconda3/envs/interspeech/lib/python3.8/site-packages/fairseq/checkpoint_utils.py", line 420, in _upgrade_state_dict
state["args"].task = "translation"
AttributeError: 'NoneType' object has no attribute 'task'
I've tried many versions and encountered this issue every time. I would greatly appreciate it if you could provide a solution. Thank you very much. Traceback (most recent call last): File "/home2/ZZT/emotion2vec-main/scripts/extract_features.py", line 76, in
main()
File "/home2/ZZT/emotion2vec-main/scripts/extract_features.py", line 44, in main
model, cfg, task = fairseq.checkpoint_utils.load_model_ensemble_and_task([checkpoint_dir]) #加载模型
File "/home2/ZZT/anaconda3/envs/interspeech/lib/python3.8/site-packages/fairseq/checkpoint_utils.py", line 279, in load_model_ensemble_and_task
state = load_checkpoint_to_cpu(filename, arg_overrides)
File "/home2/ZZT/anaconda3/envs/interspeech/lib/python3.8/site-packages/fairseq/checkpoint_utils.py", line 232, in load_checkpoint_to_cpu
state = _upgrade_state_dict(state)
File "/home2/ZZT/anaconda3/envs/interspeech/lib/python3.8/site-packages/fairseq/checkpoint_utils.py", line 420, in _upgrade_state_dict
state["args"].task = "translation"
AttributeError: 'NoneType' object has no attribute 'task'