Created
August 27, 2020 12:16
-
-
Save e96031413/1ce462b7ad4e456a43f8e17e58d3f4da to your computer and use it in GitHub Desktop.
兩個指定使用哪一顆GPU的方法
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
# CLI | |
! CUDA_VISIBLE_DEVICES=1 python train.py | |
# Inside train.py | |
import os | |
os.environ["CUDA_VISIBLE_DEVICES"] = "1" | |
# 執行時,會出現GPU的編號,此編號並非實際GPU序號,而是把第1張GPU當成第0張使用 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment