Skip to content
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

训练时loss模块的错误 #10

Open
RyanYip-Kat opened this issue Aug 13, 2021 · 1 comment
Open

训练时loss模块的错误 #10

RyanYip-Kat opened this issue Aug 13, 2021 · 1 comment

Comments

@RyanYip-Kat
Copy link

你好!当我执行 python main.py --chinese_dataset atec_ccks --model_name_or_path /path/huggingface-models/chinese-roberta-wwm-ext --seed 7777 --num_epochs 5 --model_save_path ./models/ --tensorboard_log_dir ./logs/ --adv_training 去训练的时候,就有遇到loss 模块的错误:
image
不知道你能不能帮忙出路这个问题呢?谢谢

@yym6472
Copy link
Owner

yym6472 commented Aug 17, 2021

你好,无监督设置下使用对比损失训练atec_ccks模型的命令如下:

python3 main.py --no_pair --seed 1 --use_apex_amp --apex_amp_opt_level O1 --batch_size 96 --max_seq_length 64 --evaluation_steps 20 --add_cl --cl_loss_only --cl_rate 0.15 --temperature 0.1 --learning_rate 0.0000005 --chinese_dataset atec_ccks --num_epochs 10 --da_final_1 feature_cutoff --da_final_2 shuffle --cutoff_rate_final_1 0.2 --model_name_or_path ./chinese-roberta-wwm-ext --model_save_path ./output/unsup-consert-base-atec_ccks --force_del --patience 10

如果你希望有监督设置下,使用训练集的标签的话,需要更改data_utils.py中的load_chinese_tsv_data函数,将其中if split == "train":的分支删除掉(这个分支的代码保证了训练集数据以无监督文本的形式构成训练集)。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants