How to finetune models on GPU?

#46
by Jonathanlin - opened

Hello,

  1. I have some questions that I hope can be solved. I have set up an environment for CUDA, but no matter how I try to type commands in Anaconda Prompt, it still runs on the CPU. How can I run it on the GPU?
    python.exe protGPT2finetune.py --model_name_or_path nferruz/ProtGPT2 --train_file modelTrain.txt --validation_file modelTest.txt --tokenizer_name nferruz/ProtGPT2 --do_train True --do_eval True --output_dir model --num_train_epochs 4 --local_rank -1 --per_device_train_batch_size=1 --no_cuda False --learning_rate 1e-06.
    image.png

  2. The accuracy I got after finetune is quite low. Is there any way to improve accuracy (it's only 0.27 :( ) or the recommended learning rate or epoch parameters?
    image.png
    Thanks a lot~

Owner

mmh I am not sure why is not engaging the GPU. how many gpus do you have in your workstation? Could you check inside the script that it is setting the model .to('cuda:')? or cuda:0; cuda:1, depending on the GPU you want to use?

Sign up or log in to comment