In Deep Learning “mxnet”, restrict number of core (cpu)

时间秒杀一切 提交于 2019-12-08 12:56:28

问题


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


回答1:


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

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

according to the official documentation:

 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.

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.



来源:https://stackoverflow.com/questions/44558127/in-deep-learning-mxnet-restrict-number-of-core-cpu

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!