TensorFlow (Mac OS X):无法确定 CPU 核心数:

TensorFlow (Mac OS X): can't determine number of CPU cores:

Mac OS X 必须有一个简单的设置,以消除以下警告....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

要为相关配置选项提供明确的值,您可以这样做:

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

修复将包含在下一个二进制版本中。同时,您可以按照此处的说明尝试从源代码构建:http://tensorflow.org/get_started/os_setup.md#installing_from_sources