TensorFlow(Mac OS X):无法确定CPU内核数: [英] TensorFlow (Mac OS X): can't determine number of CPU cores:
问题描述
Mac OS X必须有一个简单的设置,才能摆脱以下警告.... bash_profile中的内容?
There must be a simple setting for Mac OS X, to get rid of the following warning...something in .bash_profile?
>>> import tensorflow as tf
>>> sess = tf.Session()
can't determine number of CPU cores: assuming 4
I tensorflow/core/common_runtime/local_device.cc:25] Local device intra op parallelism threads: 4
推荐答案
要为相关配置选项提供明确的值,您可以执行以下操作:
To provide explicit values for the relevant configuration options, you can do:
NUM_CORES = ... # Choose how many cores to use.
sess = tf.Session(
config=tf.ConfigProto(inter_op_parallelism_threads=NUM_CORES,
intra_op_parallelism_threads=NUM_CORES))
针对Mac OS X的TensorFlow的初始二进制发行版中存在此问题,但应在以下提交中修复: https://github.com/tensorflow/tensorflow/commit/430a054d6134f00e5188906bc4080fb7c5035ad5
This issue is present in the initial binary release of TensorFlow for Mac OS X, but should be fixed in this commit: https://github.com/tensorflow/tensorflow/commit/430a054d6134f00e5188906bc4080fb7c5035ad5
该修复程序将包含在下一个二进制版本中.同时,您可以按照以下说明尝试从源代码进行构建: http://tensorflow. org/get_started/os_setup.md#installing_from_sources
The fix will be included in the next binary release. In the meantime, you can try building from source, by following the instructions here: http://tensorflow.org/get_started/os_setup.md#installing_from_sources
这篇关于TensorFlow(Mac OS X):无法确定CPU内核数:的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!