相关疑难解决方法(0)

如何在张量流中设置特定的gpu?

我想指定运行我的进程的gpu.我将其设置如下:

import tensorflow as tf
with tf.device('/gpu:0'):
    a = tf.constant(3.0)
with tf.Session() as sess:
    while True:
        print sess.run(a)
Run Code Online (Sandbox Code Playgroud)

但是它仍然在我的两个gpus中分配内存.

|    0      7479    C   python                         5437MiB 
|    1      7479    C   python                         5437MiB 
Run Code Online (Sandbox Code Playgroud)

tensorflow tensorflow-gpu

34
推荐指数
4
解决办法
4万
查看次数

标签 统计

tensorflow ×1

tensorflow-gpu ×1