我已经看到一些有关使用Tensorflow的GPU内存的问题,但是我已经将其安装在不支持GPU的Pine64上.
I've seen several questions about GPU Memory with Tensorflow but I've installed it on a Pine64 with no GPU support.
这意味着我正在使用非常有限的资源(仅CPU和RAM)运行它,而Tensorflow似乎想要全部,从而完全冻结了我的机器.
That means I'm running it with very limited resources (CPU and RAM only) and Tensorflow seems to want it all, completely freezing my machine.
是否有办法限制分配给Tensorflow的处理能力和内存量?类似于bazel自己的-local_resources 标志吗?
Is there a way to limit the amount of processing power and memory allocated to Tensorflow? Something similar to bazel's own --local_resources flag?
推荐答案这将创建一个会话,一次运行一个op,每个op只能运行一个线程
This will create a session that runs one op at a time, and only one thread per op
sess = tf.Session(config= tf.ConfigProto(inter_op_parallelism_threads=1, intra_op_parallelism_threads=1))不确定是否要限制内存,它似乎是按需分配的,当我的网络需要100GB的RAM时,我让TensorFlow冻结了我的机器,所以我的解决方案是使网络需要更少的RAM.
Not sure about limiting memory, it seems to be allocated on demand, I've had TensorFlow freeze my machine when my network wanted 100GB of RAM, so my solution was to make networks that need less RAM
更多推荐
限制Tensorflow CPU和内存使用率
发布评论