Created
November 8, 2019 10:45
-
-
Save rahulvigneswaran/ed2137c6086bdd4bdbb3b3c60384dff5 to your computer and use it in GitHub Desktop.
Select GPU in Pytorch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
parser = argparse.ArgumentParser() | |
parser.add_argument("--gpu", default="0", type=str) | |
args = parser.parse_args() | |
os.environ["CUDA_DEVICE_ORDER"]="PCI_BUS_ID" | |
os.environ["CUDA_VISIBLE_DEVICES"]=args.gpu |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment