Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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
like image 685
Mike Chirico Avatar asked Nov 09 '15 20:11

Mike Chirico


People also ask

What is TensorFlow Macos?

TensorFlow is an open source software library for high performance numerical computation.


1 Answers

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

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

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

like image 94
mrry Avatar answered Oct 02 '22 09:10

mrry