You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Failed to run example script for sequence_classification_multilabel: Target size (torch.Size([32])) must be the same as input size (torch.Size([32, 27]))
#130
Closed
Chen9154 opened this issue
Jul 5, 2022
· 0 comments
I copy the training command from here and modify a little.
python -m torch.distributed.launch $DISTRIBUTED_ARGS main.py \ --mode train \ --tables=train.csv,dev.csv \ --input_schema=content_seq:str:1,label:str:1 \ --first_sequence=content_seq \ --label_name=label \ --label_enumerate_values=母婴,三农,科学,美文,科技,时尚,房产,美食,艺术,职场,健康,财经,国际,家居,娱乐,文化,教育,游戏,读书,动漫,体育,旅游,汽车,搞笑,健身,宠物,育儿 \ --checkpoint_dir=./multi_label_classification_model \ --learning_rate=3e-5 \ --epoch_num=1 \ --random_seed=42 \ --save_checkpoint_steps=100 \ --sequence_length=128 \ --train_batch_size=32 \ --app_name=text_classify \ --user_defined_parameters=' pretrain_model_name_or_path=hfl/chinese-roberta-wwm-ext multi_label=True '
And here's the error stack.
It seems the Target has a wrong size (torch.Size([32])) which should be torch.Size([32, 27]) under the multilabel settings.
The text was updated successfully, but these errors were encountered: