os.environ["CUDA_VISIBLE_DEVICES"]
时间: 2024-02-18 17:48:40 浏览: 156
在tensorflow中设置使用某一块GPU、多GPU、CPU的操作
5星 · 资源好评率100%
= "0"
This line of code sets the environment variable "CUDA_VISIBLE_DEVICES" to "0", which means that only the first GPU (device 0) will be visible to the program. This is useful when you have multiple GPUs and you want to restrict the program to use only a specific one.
阅读全文