timoschick / pet

This repository contains the code for "Exploiting Cloze Questions for Few-Shot Text Classification and Natural Language Inference"
https://arxiv.org/abs/2001.07676
Apache License 2.0
1.62k stars 283 forks source link

How to assign GPU? #52

Closed windhxs closed 2 years ago

windhxs commented 2 years ago

It seems that your code will utilize all GPU,but I share a server with others, and it turns out to be something like cuda out of memory. Is there any parameters that can assign which GPU to use?

stefan-it commented 2 years ago

Hi @windhxs ,

fastest solution would be to set CUDA_VISIBLE_DEVICES environment variable (incl. the id of your desired GPU to use), such as: export CUDA_VISIBLE_DEVICES=1 or you can prepend this variable when calling python: CUDA_VISIBLE_DEVICES=1 python3 cli.py.

More infos here :hugs:

windhxs commented 2 years ago

thanks a lot!