Tensorflow如何选择GPU

CUDA_VISIBLE_DEVICES=1 python run.py


or

import os
os.environ["CUDA_VISIBLE_DEVICES"]="1"
原文地址:https://www.cnblogs.com/huangshiyu13/p/6479916.html