在深度学习“ mxnet”中,限制核心数(cpu) [英] In Deep Learning "mxnet", restrict number of core (cpu)

查看:264
本文介绍了在深度学习“ mxnet”中,限制核心数(cpu)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

命令 ctx = mx.cpu()占用了所有可用的CPU。如何限制仅使用某个数字-说出8个核心中的6个

The command "ctx=mx.cpu()" is taking all available CPU. How to restrict to use a certain number only - say 6 out of 8 core

推荐答案

不幸的是-不。即使cpu上下文将int作为输入参数

Unfortunately - no. Even though the cpu context has int as an input argument:

def cpu(device_id=0):
    """Returns a CPU context.

根据官方文档:

 Parameters
 ----------
 device_id : int, optional
     The device id of the device. `device_id` is not needed for CPU.
     This is included to make interface compatible with GPU.

但是,从理论上讲,将来可能会更改,因为存在device_id参数。但是现在MXNet会使用所有可用的内核。

However, in theory, it might be changed in the future since the device_id argument is there. But for now MXNet takes all available cores.

这篇关于在深度学习“ mxnet”中,限制核心数(cpu)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆