Skip to content

when I run the shell,hava a CUDA error to me. it will runing on a right status if i use cpu. #2

@WavesLi

Description

@WavesLi

python3 run_classifier_word.py --task_name NEWS --do_train --do_eval --data_dir $GLUE_DIR/ --vocab_file $BERT_BASE_DIR/vocab.txt --bert_config_file $BERT_BASE_DIR/bert_config.json --init_checkpoint $BERT_BASE_DIR/pytorch_model.bin --max_seq_length 256 --train_batch_size 24 --learning_rate 2e-5 --num_train_epochs 50.0 --output_dir ./newsAll_output/ --local_rank 3
04/16/2019 16:33:35 - INFO - main - device cuda:3 n_gpu 1 distributed training True
04/16/2019 16:33:35 - INFO - main - LOOKING AT /home/gpu0/Litao/Bert/Bert-Pytorch-Chinese-TextClassification/Corpus/train.tsv
label_list.size:10

Traceback (most recent call last):
File "run_classifier_word.py", line 704, in
main()
File "run_classifier_word.py", line 559, in main
model.to(device)
File "/opt/anaconda3/lib/python3.6/site-packages/torch/nn/modules/module.py", line 381, in to
return self._apply(convert)
File "/opt/anaconda3/lib/python3.6/site-packages/torch/nn/modules/module.py", line 187, in _apply
module._apply(fn)
File "/opt/anaconda3/lib/python3.6/site-packages/torch/nn/modules/module.py", line 187, in _apply
module._apply(fn)
File "/opt/anaconda3/lib/python3.6/site-packages/torch/nn/modules/module.py", line 187, in _apply
module._apply(fn)
File "/opt/anaconda3/lib/python3.6/site-packages/torch/nn/modules/module.py", line 193, in _apply
param.data = fn(param.data)
File "/opt/anaconda3/lib/python3.6/site-packages/torch/nn/modules/module.py", line 379, in convert
return t.to(device, dtype if t.is_floating_point() else None, non_blocking)
RuntimeError: CUDA error: invalid device ordinal

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions