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

RuntimeError: device type error #136

Closed
Chen9154 opened this issue Jul 8, 2022 · 1 comment
Closed

RuntimeError: device type error #136

Chen9154 opened this issue Jul 8, 2022 · 1 comment

Comments

@Chen9154
Copy link
Collaborator

Chen9154 commented Jul 8, 2022

I copy the training command from text match tutorial and modify a little.

python -m torch.distributed.launch $DISTRIBUTED_ARGS main.py \ --mode train \ --worker_gpu=1 \ --tables=train.csv,dev.csv \ --input_schema=example_id:str:1,sent1:str:1,sent2:str:1,label:str:1,cate:str:1,score:str:1 \ --first_sequence=sent1 \ --second_sequence=sent2 \ --label_name=label \ --label_enumerate_values=0,1 \ --checkpoint_dir=./text_match_two_tower_model_dir \ --learning_rate=3e-5 \ --epoch_num=1 \ --random_seed=42 \ --save_checkpoint_steps=100 \ --sequence_length=128 \ --train_batch_size=32 \ --app_name=text_match \ --user_defined_parameters=' pretrain_model_name_or_path=hfl/chinese-roberta-wwm-ext two_tower=True loss_type=hinge_loss margin=0.45 gamma=32 embedding_size=256 '

(the code in knowledge_language_understanding shares the same error.

And here's the error stack in text_match.
image

@Chen9154
Copy link
Collaborator Author

fixed by replacing "gpu:0" with "cuda:0" in EasyNLP/easynlp/appzoo/text_match/evaluator.py.

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

1 participant