14

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
4

1 回答 1

24

要为相关配置选项提供显式值,您可以执行以下操作:

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))

此问题存在于 TensorFlow for Mac OS X 的初始二进制版本中,但应在此提交中修复:https ://github.com/tensorflow/tensorflow/commit/430a054d6134f00e5188906bc4080fb7c5035ad5

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

于 2015-11-09T20:52:32.577 回答