首页 文章

在深度学习“mxnet”中,限制核心数(cpu)

提问于
浏览
0

命令“ctx = mx.cpu()”占用所有可用的CPU . 如何限制只使用一定数量 - 比如8个核心中的6个

1 回答

  • 1

    很不幸的是,不行 . 即使cpu上下文将int作为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占用了所有可用内核 .

相关问题