2017-06-15 75 views
0

命令「ctx = mx.cpu()」取所有可用的CPU。如何限制只能使用一定的數字 - 比如8個核心中的6個在深度學習「mxnet」中,限制核心數(cpu)

+0

我不認爲是否有這樣的接口。你爲什麼真的需要這個?無論如何,[看看這個](https://stackoverflow.com/questions/43569460/how-to-limit-pythons-use-of-cores-globally-in-ubuntu) – Mohammad

+0

截至目前,深度學習算法在「 「mxnet」採用所有可用的CORE,因此需要控制。 – Shiv

回答

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採用所有可用內核。